home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacTech 1 to 12
/
MacTech-vol-1-12.toast
/
Reference
/
the cmsp digests ('94-'97)
/
csmp digest Vol 4 No 030
< prev
next >
Wrap
Text File
|
1997-01-02
|
134KB
|
4,137 lines
C.S.M.P. Digest Sat, 21 Dec 96 Volume 4 : Issue 30
Today's Topics:
A better way to get a window's current position??
Alpha Editor - Tcl Engine?
AppleEvent-Script example
AppleScript "character count"
GameWerks question
Getting a unique ID for a Mac
Getting name field from an FSSpec
Is this a MacOS disk cache bug?
LEX and YACC on the Mac
MacsBug - Memory
Open Tranport: Why no T_CONNECT signal?
PBHGetVInfo return the wrong number of items in a root directory?
Put file without Dialog Box
Question about "The Debugger"
QuickTime Musical Instruments?
Screen Redrawing Command Wanted
Scrolling
Sound Input Manager
SpriteWorld 2
Symantec C++ fstreams write unreadable files
Unlocking a Volume
Utility pattern?
[Q] C++ and handles
[Q] Convert double to string in C. How?
[Q] Rebooting from MacsBug
[Q] Setting the cursor location?
[Q] Time of last key down?
[Q] disposing handles to structs
[Q] library-class library for easier MacOS programming?
[Q]: Patching _Launch?
[Q]: recovering mac stuffit archive with NDD 3.1 ?
code for Async File Output
The Comp.Sys.Mac.Programmer Digest is moderated by Mark Aiken
(marka@ee.mcgill.ca).
The digest is a collection of article threads from the internet
newsgroups comp.sys.mac.programmer.help, csmp.tools, csmp.misc and
csmp.games. It is designed for people who read news semi-regularly and
want an archive of the discussions. If you don't know what a
newsgroup is, you probably don't have access to it. Ask your systems
administrator(s) for details. If you don't have access to news, you
may still be able to post messages to the group by using a mail server
like anon.penet.fi (mail help@anon.penet.fi for more information).
Each issue of the digest contains one or more sets of articles (called
threads), with each set corresponding to a 'discussion' of a particular
subject. The articles are not edited; all articles included in this digest
are in their original posted form (as received by our news server at
ee.mcgill.ca). Article threads are not added to the digest until the last
article added to the thread is at least two weeks old (this is to ensure that
the thread is dead before adding it to the digest). Article threads that
consist of only one message are generally not included in the digest.
The digests can be obtained by email, ftp or through the World Wide Web.
If you want to receive the digest by mail, send email to
majordomo@ee.mcgill.ca with no subject and one of the following commands
as body:
help Sends you a summary of commands
subscribe csmp Adds you to the mailing list
unsubscribe csmp Removes you from the list
Once you have subscribed, you will automatically receive each new
issue as it is created.
Back issues are available by ftp from Info-Mac mirror sites in the
per/csmp subdirectory, e.g.
ftp://sumex-aim.stanford.edu/info-mac/per/csmp/
The contents of all back issues can be searched by accessing the
following URL, courtesy of Andrew Barry (ajbarry@ozemail.com.au):
http://marvin.stattech.com.au/search.html
They can also be searched through the following URLs, thanks to
Tim Tuck (Tim.Tuck@sensei.com.au):
http://wais.sensei.com.au/searchform.html
wais://wais.sensei.com.au:210/csmp?
-------------------------------------------------------
>From slur@world.std.com (Scott Lahteine)
Subject: A better way to get a window's current position??
Date: Wed, 4 Dec 1996 16:17:40 GMT
Organization: Hot Eggs
Is there a more elegant way to get the current position of a window?
Here's the code I'm using:
pWindRec->lastPoint =
*(Point*)&(**((WindowPeek)pWindow)->contRgn).rgnBBox.top;
1. Cast GrafPtr to WindowPeek
2. Dereference the RgnHandle for the content region
3. Get the address of the rgnBBox.top (=topLeft) field
4. Cast the result as a Point Pointer
5. Dereference the pointer to get the topLeft point
My CodeWarrior 8 won't allow the simpler:
pWindRec->lastPoint =
(**((WindowPeek)pWindow)->contRgn).rgnBBox.topLeft;
The error comes down to: "topLeft is not a struct member"
--
- scott slur@world.std.com
"A painting of a rice cake does not satisfy hunger."
+++++++++++++++++++++++++++
>From johns@efn.org (Johnny Selhorst)
Date: Wed, 04 Dec 1996 09:25:50 -0800
Organization: Just me
In article <slur-ya023480000412961117400001@news.std.com>,
slur@world.std.com (Scott Lahteine) wrote:
>Is there a more elegant way to get the current position of a window?
>Here's the code I'm using:
>
>pWindRec->lastPoint =
>*(Point*)&(**((WindowPeek)pWindow)->contRgn).rgnBBox.top;
>
>1. Cast GrafPtr to WindowPeek
>2. Dereference the RgnHandle for the content region
>3. Get the address of the rgnBBox.top (=topLeft) field
>4. Cast the result as a Point Pointer
>5. Dereference the pointer to get the topLeft point
>
>My CodeWarrior 8 won't allow the simpler:
>
>pWindRec->lastPoint =
>(**((WindowPeek)pWindow)->contRgn).rgnBBox.topLeft;
>
>The error comes down to: "topLeft is not a struct member"
How about this:
Point origin = {0, 0};
SetPort(pWindow);
LocalToGlobal(&origin);
Much cleaner.
Johnny
+++++++++++++++++++++++++++
>From magao@zip.com.au (Timothy C. Delaney)
Date: Thu, 05 Dec 1996 06:37:48 +1100
Organization: The Zipsters
In article <johns-ya023060030412960925500001@news.efn.org>, johns@efn.org
(Johnny Selhorst) wrote:
> How about this:
>
> Point origin = {0, 0};
> SetPort(pWindow);
> LocalToGlobal(&origin);
A "better" way is to not assume that the origin is (0, 0) - so use the top
left corner of the port rect.
Point origin = { pWindow->portRect.top, pWindow->portRect.left };
SetPort(pWindow);
LocalToGlobal(&origin);
Note - this would be slower than the original code which accessed the
content region.
--
<http://www.zip.com.au/~magao/standard_disclaimer.html>
_/_/_/_/
__| __| _/_| _/_/_/ _/_| _/_/_/
_/_| _/_| _/ _| _/ _/ _| _/ _/
-/ _|_/ _| _/_/_/_| _/ _/_/_/ _/_/_/_| _/ _/
_/ __/ _| _/ _| _/_/_/ _/ _| _/_/_/
Tim Delaney magao@zip.com.au
Mac/Windows SW Engineer, Bold magao@bold.com.au
+++++++++++++++++++++++++++
>From spamwall@zercom.net (Martin-Gilles Lavoie)
Date: 5 Dec 1996 13:33:23 GMT
Organization: Groupimage, inc.
In article <johns-ya023060030412960925500001@news.efn.org>, johns@efn.org
(Johnny Selhorst) wrote:
> In article <slur-ya023480000412961117400001@news.std.com>,
> slur@world.std.com (Scott Lahteine) wrote:
[...]
>
> How about this:
>
> Point origin = {0, 0};
> SetPort(pWindow);
> LocalToGlobal(&origin);
>
> Much cleaner.
Cleaner yes, but does not solve the problem. The above code does not take
into account the thickness of the window border, and it's title bar (if
any).
=================================================================
Please reply using the following address, rather than the
"reply-to" address (my mail box is being filled with junk mail).
=================================================================
Martin-Gilles Lavoie | Opinions expressed herein are just that.
mouser@zercom.net | "No! Do, or do not. There is no try."
Globimage, inc. | --Yoda on error handling
+++++++++++++++++++++++++++
>From BHuey@worldnet.att.net (Hugh Johnson)
Date: Wed, 04 Dec 1996 21:38:24 -0600
Organization: Semplice
In article <slur-ya023480000412961117400001@news.std.com>,
slur@world.std.com (Scott Lahteine) wrote:
> Is there a more elegant way to get the current position of a window?
> Here's the code I'm using:
>
> pWindRec->lastPoint =
> *(Point*)&(**((WindowPeek)pWindow)->contRgn).rgnBBox.top;
>
#define topLeft(x) (((Point*)&( x ))[0])
#define GlobalBBox(aWPtr) ((*(WindowPeek(aWPtr))->strucRgn)->rgnBBox)
#define GlobalTopLeft(aWPtr) topLeft(GlobalBBox(aWPtr))
---------------------------
>From "Jason M. Smith" <jsmith@es.com>
Subject: Alpha Editor - Tcl Engine?
Date: Wed, 04 Dec 1996 12:58:33 -0700
Organization: Evans & Sutherland
Since Alpha allows the creation of new tcl/tk additions to it, I have
to ask... does Alpha use an internal tcl/tk engine? If so, what tcl/tk
version is supported? Also, would it be possible for it to use the
System level tcl/tk shared library from Sun, thereby saving disk space?
--
Jason M. Smith
Software Engineer 1215 S. McClelland St. 600 Komas Dr.
Display Group Salt Lake, UT 84105 Salt Lake City, UT 84158
Evans & Sutherland (801) 486-2378 (H) (801) 588-7552 (W)
+++++++++++++++++++++++++++
>From vince@deas.harvard.edu (Vince Darley)
Date: Wed, 04 Dec 1996 20:01:04 -0500
Organization: Harvard University
In article <32A5D7E9.2781E494@es.com>, "Jason M. Smith" <jsmith@es.com> wrote:
>Since Alpha allows the creation of new tcl/tk additions to it, I have
>to ask... does Alpha use an internal tcl/tk engine? If so, what tcl/tk
>version is supported? Also, would it be possible for it to use the
>System level tcl/tk shared library from Sun, thereby saving disk space?
[Disclaimer: Pete Keleher, author of Alpha, will be able to answer this
question more accurately than I, but these are my impressions from
_extensive_ use, and from some correspondence with Pete]
Alpha does use an internal Tcl only engine --- all the graphical features
are coded separately. It currently uses Tcl7.4. Pete looked at moving to
tcl7.5, but the added memory footprint dissuaded him (~150k more if I
recall). I would have thought it could use a system level shared Tcl
library, but that this would involve some minor modifications to the
current Alpha<-->Tcl interaction. Indeed this would save disk space, and I
think it's a great idea.
Also this would ultimately allow Alpha to use Tcl 8.0 and therefore the Tcl
compiler --- which would be a great boon.
--
-********* *-
-* Vince *-
-* *********-
<http://www.fas.harvard.edu/~darley/>
+++++++++++++++++++++++++++
>From rjohnson@Sun.COM (Ray Johnson)
Date: 5 Dec 1996 03:29:15 GMT
Organization: Sun Microsystems Inc., Mountain View, CA
Jason M. Smith (jsmith@es.com) wrote:
: Since Alpha allows the creation of new tcl/tk additions to it, I have
: to ask... does Alpha use an internal tcl/tk engine? If so, what tcl/tk
: version is supported? Also, would it be possible for it to use the
: System level tcl/tk shared library from Sun, thereby saving disk space?
It would certainly be possible. I'd love to see it. However, Peter
is a full time prof at UMD which I'm sure imposses a few time constraints
on him.
If there are any technical limitations I'd like to know about them.
The goal of making the Tcl/Tk shared libraries is so developers can
leverage them to make smaller more powerful apps. Serveral apps are
doing just that...
Ray Johnson
http://www.sunlabs.com/people/raymond.johnson/
---------------------------
>From Rich Allen <hcir@alaska.net>
Subject: AppleEvent-Script example
Date: Sun, 01 Dec 1996 20:23:57 -0900
Organization: Allen ReSearch
Example program of sending AppleEvents to AppleScripts, ie. those items
in the Scripting Additons folder.
Thanks
--
Rich & Sue Allen
Allen ReSearch
HC 31 Box 5257
Wasilla AK 99654
mailto:hcir@alaska.net
http://www.alaska.net/~hcir/
+++++++++++++++++++++++++++
>From uzs90z@uni-bonn.de (Michael Schuerig)
Date: Mon, 2 Dec 1996 17:17:07 +0100
Organization: RHRZ - University of Bonn (Germany)
Rich Allen <hcir@alaska.net> wrote:
> Example program of sending AppleEvents to AppleScripts, ie. those items
> in the Scripting Additons folder.
Just send the event to yourself. Look up class ID, event ID and
parameters in the 'aete' resource of the scripting addition.
Scripting Additions (aka osaxen) are installed in the system-wide AE
dispatch table so they're available everywhere (well, better not call
them at interrupt time).
Michael
- -
Michael Schuerig
mailto:uzs90z@uni-bonn.de
http://www.rhrz.uni-bonn.de/~uzs90z/
+++++++++++++++++++++++++++
>From mh@primenet.com (Mark Hartman)
Date: 2 Dec 1996 13:20:03 -0700
Organization: Mark Hartman Computer Solutions
In article <32A267E5.6952@alaska.net>, hcir@alaska.net wrote:
>Example program of sending AppleEvents to AppleScripts, ie. those items
>in the Scripting Additons folder.
Those aren't AppleScripts. They're - amazingly enough - scripting additions,
otherwise known as OSAXen (Open Scripting Architecture eXtensions). They
add functionality to AppleScripts.
==========================================================================
Mark Hartman Computer Solutions - specializing in all things Macintosh
C C++ 4th Dimension Networking System design/architecture
tel +1(714)758.0640 -+- fax +1(714)999.5030 -+- e-mail mh@primenet.com
==========================================================================
"Hello, my name is Mark, and I've been Intel-free for 8 years and 2 days."
---------------------------
>From trehling@aol.com
Subject: AppleScript "character count"
Date: 2 Dec 1996 10:17:01 GMT
Organization: AOL Bertelsmann Online GmbH & Co. KG http://www.germany.aol.com
Hope someone can help!
I want to write an AppleScript that counts the characters of a filename
and puts this value into the clipboard.
That's all.
I use the script
tell application "Finder"
activate
count the characters of selection
end tell
I get this message in the Eventprotokoll
"tell application "Finder"
activate
count every character of selection
0
end tell"
What's wrong it is =0
Thank you
Thorsten
+++++++++++++++++++++++++++
>From jwbaxter@olympus.net (John W. Baxter)
Date: Mon, 02 Dec 1996 07:38:54 -0800
Organization: Internet for the Olympic Peninsula
In article <19961202101801.FAA10175@ladder01.news.aol.com>,
trehling@aol.com wrote:
>Hope someone can help!
>
>I want to write an AppleScript that counts the characters of a filename
>and puts this value into the clipboard.
>That's all.
>I use the script
>
>tell application "Finder"
>activate
>count the characters of selection
>end tell
>
>I get this message in the Eventprotokoll
>
>"tell application "Finder"
> activate
> count every character of selection
> 0
>end tell"
>What's wrong it is =0
tell application "Finder"
set temp to name of item 1 of selection
end tell
count of temp
--> returns 5 when the selection consists of the disk icon "Blake" (my
startup drive)
The count of temp statement can be inside or outside the tell block.
Finder returns selection as a list of object specifiers (references) of
the items (disks, files, printers, ...) selected, even when there is only
one (some other Finder events aren't that well behaved).
A list of object specifiers has no characters (it would appear...I've
never asked that the characters of such a list be counted).
--John
--
The primary cause of problems is solutions.
John W. Baxter Port Ludlow, WA, USA jwbaxter@olympus.net
+++++++++++++++++++++++++++
>From mh@primenet.com (Mark Hartman)
Date: 2 Dec 1996 13:33:03 -0700
Organization: Mark Hartman Computer Solutions
In article <19961202101801.FAA10175@ladder01.news.aol.com>,
trehling@aol.com wrote:
>Hope someone can help!
>
>I want to write an AppleScript that counts the characters of a filename
>and puts this value into the clipboard.
>That's all.
>I use the script
>
>tell application "Finder"
>activate
>count the characters of selection
>end tell
The following worked for me:
tell application "Finder"
activate
copy the name of the selection to a
count of characters of a
end tell
========================================================================
Mark Hartman Computer Solutions - specializing in all things Macintosh
C C++ 4th Dimension Networking System design/architecture
tel +1(714)758.0640 -+- fax +1(714)999.5030 -+- e-mail mh@primenet.com
========================================================================
"Success flourishes only in perserverance" - Baron Manfred vonRichthofen
+++++++++++++++++++++++++++
>From Jackson Software Development <development@jacksoncorp.com>
Date: 3 Dec 1996 15:09:50 GMT
Organization: Jackson Software
In article <mh-0212961233310001@ip135.sna.primenet.com> Mark Hartman,
mh@primenet.com writes:
>The following worked for me:
>
>tell application "Finder"
> activate
> copy the name of the selection to a
> count of characters of a
>end tell
Is there any reason that people are using a verbose sentence structure
like "count of characters of a" instead of "length of a"? Is there a
symantic difference, or is it just a style preference?
Darrin
---------------------------
>From nyrath@clark.net (Nyrath the nearly wise)
Subject: GameWerks question
Date: 26 Nov 1996 14:38:16 GMT
Organization: morthrai.morgoth.web
Does GameWerks have wrapper classes for Direct X and Game Sockets
yet?
My boss wants me to write a Mac/Windows cross platform game
with internet capability. Direct Play on the Windows side and
Net Sprocket on the Mac side would seem to be a solution if
I can find a x-platform development system that can handle both.
Thanks in advance.
Winchell Chung
+++++++++++++++++++++++++++
>From Steve Israelson <steve_israelson@mindlink.net>
Date: Tue, 26 Nov 1996 18:29:40 -0800
Organization: Totally Hip Software
Hi,
Also, can Gamewerks be compiled on a windows machine using Codewarrior
for windows (beta or whatever)?
I need to do crossplatform development with different people working on
each platform on one project?
Steve Israelson
Totally Hip Software
+++++++++++++++++++++++++++
>From MWRon@metrowerks.com (MW Ron)
Date: Tue, 26 Nov 1996 19:04:50 -0500
Organization: Metrowerks
In article <57evco$6gb@clarknet.clark.net>, nyrath@clark.net (Nyrath the
nearly wise) wrote:
>Does GameWerks have wrapper classes for Direct X and Game Sockets
>yet?
>
>My boss wants me to write a Mac/Windows cross platform game
>with internet capability. Direct Play on the Windows side and
>Net Sprocket on the Mac side would seem to be a solution if
>I can find a x-platform development system that can handle both.
We do wrap part of DirectX, but for now we only wrap DirectDraw, and
DrawSprocket, soon we will add Netstuff, but we need to wait for a 3rd
party on this.
You might want to note that the next version will have public sourcecode,
just like PP, so users can add their own stuff.
Ron
--
METROWERKS Ron Liechty
"Software at Work" MWRon@metrowerks.com
http://www.metrowerks.com/about/people/rogues.html#mwron
+++++++++++++++++++++++++++
>From MWRon@metrowerks.com (MW Ron)
Date: Wed, 27 Nov 1996 12:26:34 -0500
Organization: Metrowerks
In article <329BA793.34F9@mindlink.net>, Steve Israelson
<steve_israelson@mindlink.net> wrote:
>Also, can Gamewerks be compiled on a windows machine using Codewarrior
>for windows (beta or whatever)?
GameCode and the GameCode Libraries (we've changed their names to
eliminate some confusion) is a cross platform framework and will ship with
the Windows95/NT hosted CodeWarriors.
Ron
--
METROWERKS Ron Liechty
"Software at Work" MWRon@metrowerks.com
http://www.metrowerks.com/about/people/rogues.html#mwron
+++++++++++++++++++++++++++
>From alexr@bungie.com (Alex Rosenberg)
Date: Sat, 30 Nov 1996 22:01:29 -0600
Organization: Hackers Anonymous
In article <57evco$6gb@clarknet.clark.net>, nyrath@clark.net (Nyrath the
nearly wise) wrote:
>My boss wants me to write a Mac/Windows cross platform game
>with internet capability. Direct Play on the Windows side and
>Net Sprocket on the Mac side would seem to be a solution if
>I can find a x-platform development system that can handle both.
This is *very* important: DirectPlay uses undocumented proprietary
protocols. Any game using it cannot do cross-platform networking. This
means that if you use DirectPlay, you will not be able to connect both Mac
and PC users.
My understanding is that Apple is working on a version of NetSprocket for
Win95 to remidy this.
- ----------------------------------------------------
| Alexander M. Rosenberg <mailto:alexr@bungie.com>|
| Bungie Software <http://www.bungie.com> |
| Nobody cares what I say. |
+++++++++++++++++++++++++++
>From jgoldshlag@wesleyan.edu (Josh Goldshlag)
Date: Mon, 02 Dec 1996 09:07:07 -0500
Organization: would be cool if I had any.....
In article <57evco$6gb@clarknet.clark.net>, nyrath@clark.net (Nyrath the
nearly wise) wrote:
> Does GameWerks have wrapper classes for Direct X and Game Sockets
> yet?
Excuse my ignorance, but what is GameWerks? It sounds like something
included with CodeWarrior...
Josh
---------------------------
>From "Joey Edelstein" <joeyhd@netvision.net.il>
Subject: Getting a unique ID for a Mac
Date: 28 Nov 1996 12:02:06 GMT
Organization: NetVision LTD.
Hi!
Is there an established way to get a unique ID for a Mac? I am responsible
for maintaining an installation program for the Mac. We would like to be
able to check if this is the same computer a user previously installed
software on or a new one. If there is no established way to do this can
you suggest one.
Please reply by Email as well as posting to news grope so I don't miss you
answer. My news server sometimes plays tricks on me.
Thank you
Joey
--
\\|//
(o o)
*****oOOo*( )*oOOo**************************************************
Joey Edelstein Email: joeyhd@netvision.net.il
Heshev Development Ltd.
http://members.tripod.com/~JoeyE
**************************************************oOOo*( )*oOOo*****
(o o)
//|\\
+++++++++++++++++++++++++++
>From blob@ricochet.net
Date: Thu, 28 Nov 1996 11:26:02 -0700
Organization: (none)
In article <01bbdd23$8fb94c20$98785ac2@JoeyPc.netvision.net.il>, "Joey
Edelstein" <joeyhd@netvision.net.il> wrote:
> Is there an established way to get a unique ID for a Mac?
No. There is no unique ID for a Mac. There are a couple of things you can
look for on certain Macs.
* The Ethernet ID on any Mac with a built-in Ethernet device or a Ethernet
card.
* The serial number of the SCSI or IDE hard disk, if the disk happens to
have one (most SCSI disks don't)
That's it. Neither item applies to a large number of Macs; for instance,
those PowerBooks without built-in Ethernet.
There simply isn't a unique ID on the Macintosh.
--
(Pointers to other Mac programming web sites at
<http://devworld.apple.com/dev/geeks.html>)
+++++++++++++++++++++++++++
>From krycyb@bergen.org (Krys Cybulski)
Date: Fri, 29 Nov 1996 15:48:24 GMT
Organization: (none)
There are a coupl things you could do...
For example, you could take a whole bunch of information from the HD, like
when it was formatted, its size, etc. I have no idea how to do this, but
it should be fairly unique per person. Also, a problem with this is that
when the usr changes/reformats the drive, it is going to look different so
it is not fool proof.
-- Krys
In article <01bbdd23$8fb94c20$98785ac2@JoeyPc.netvision.net.il>, "Joey
Edelstein" <joeyhd@netvision.net.il> wrote:
> Hi!
> Is there an established way to get a unique ID for a Mac? I am responsible
> for maintaining an installation program for the Mac. We would like to be
> able to check if this is the same computer a user previously installed
> software on or a new one. If there is no established way to do this can
> you suggest one.
> Please reply by Email as well as posting to news grope so I don't miss you
> answer. My news server sometimes plays tricks on me.
> Thank you
> Joey
>
>
> --
> \\|//
> (o o)
> *****oOOo*( )*oOOo**************************************************
> Joey Edelstein Email: joeyhd@netvision.net.il
> Heshev Development Ltd.
> http://members.tripod.com/~JoeyE
> **************************************************oOOo*( )*oOOo*****
> (o o)
> //|\\
+++++++++++++++++++++++++++
>From Chelly Green <chelly@eden.com>
Date: Sun, 01 Dec 1996 17:08:27 -0600
Organization: -
Joey Edelstein wrote:
>
> Hi!
> Is there an established way to get a unique ID for a Mac?
What for? Maybe you are asking the wrong question, i.e. getting some
unique identifier is part of your solution. What is the problem?
> I am responsible
> for maintaining an installation program for the Mac. We would like to be
> able to check if this is the same computer a user previously installed
> software on or a new one.
For informational purposes? Why do you care if it is the same computer
or a different? What is a "computer"? The motherboard? The hard drive
volume? Both?
> If there is no established way to do this can you suggest one.
Don't bother. If this has something to do with limiting the use of
software, don't bother. Why limit the use for a customer? Do they have
to go to another company to get rid of dumb limitations intentionally
added?
--
Chelly Green | chelly@eden.com | C++ - http://www.eden.com/~chelly
+++++++++++++++++++++++++++
>From mh@primenet.com (Mark Hartman)
Date: 3 Dec 1996 23:53:04 -0700
Organization: Mark Hartman Computer Solutions
In article <32A20FCC.6DB3@eden.com>, chelly@eden.com wrote:
>Joey Edelstein wrote:
>>
>> Hi!
>> Is there an established way to get a unique ID for a Mac?
>
>What for? Maybe you are asking the wrong question, i.e. getting some
>unique identifier is part of your solution. What is the problem?
>
>> I am responsible
>> for maintaining an installation program for the Mac. We would like to be
>> able to check if this is the same computer a user previously installed
>> software on or a new one.
>
>For informational purposes? Why do you care if it is the same computer
>or a different? What is a "computer"? The motherboard? The hard drive
>volume? Both?
>
>> If there is no established way to do this can you suggest one.
>
>Don't bother. If this has something to do with limiting the use of
>software, don't bother. Why limit the use for a customer? Do they have
>to go to another company to get rid of dumb limitations intentionally
>added?
Now that Chelly has finished with the soapbox, let me suggest an answer
to the question without the histrionics.
Try the Ethernet ID.
======================================================================
Mark Hartman Computer Solutions - specializing in all things Macintosh
C C++ 4th Dimension Networking System design/architecture
tel +1(714)758.0640 -+- fax +1(714)999.5030 -+- e-mail mh@primenet.com
======================================================================
No DIP switches. No CONFIG.SYS. No headaches. No regrets. Macintosh.
---------------------------
>From raterwil@ucla.edu (Robert Terwilliger)
Subject: Getting name field from an FSSpec
Date: 26 Nov 1996 23:44:06 GMT
Organization: UCLA Division of Brain Mapping
I am trying to get the name field from an FSSpec and am getting errors. I
am running CW 9 with MW Debug. I will give an example.
The file's name is "b2.buchar" and the FSSpec is *theFile.
When I inspect the *theFile using the debugger, I find the name field to
be the following:
theFile->name = "/pb2.buchar"
which is what I expect, due to the pascal nomenclature.
However, if I print the string to the SOUIX console, I get:
<the code>
printf("theFile->name = %s.\n", theFile->name);
<the result>
theFile->name = b2.bucharbfloat_.
which is not what I expect. I have files on my disk with the suffix
"bfloat" but they are not even on the same directory as "b2.buchar". Why
am I getting these extra characters attached to the string when they do
not appear when I inspect the code using MW Debug? I need to pass this
string to another function but cannot do so until I resolve this problem.
+++++++++++++++++++++++++++
>From matt@colorpar.com (Matt Gieselman)
Date: Tue, 26 Nov 1996 17:40:40 -0800
Organization: The Color Partnership
In article <raterwil-2611961544260001@149.142.81.108>, raterwil@ucla.edu
(Robert Terwilliger) wrote:
> When I inspect the *theFile using the debugger, I find the name field to
> be the following:
>
> theFile->name = "/pb2.buchar"
>
> which is what I expect, due to the pascal nomenclature.
>
> However, if I print the string to the SOUIX console, I get:
>
> <the code>
> printf("theFile->name = %s.\n", theFile->name);
>
> <the result>
> theFile->name = b2.bucharbfloat_.
You need to call p2cstr() to convert your Pascal style
string into a C style string. You can do the conversion
yourself by doing a BlockMove using the first value in
the Pascal string and putting a null character at the
end of the string.
So what is happening is printf spits out the string until
it hits a null character, put since the string is Pascal
there isn't a null character.
Hope this helps,
Matt
- ------------------------------------------------------------
Matt Gieselman
Software Engineer and Juggler
The Color Partnership
matt@colorpar.com
www.colorpar.com
- -----------------------------------------------------------
+++++++++++++++++++++++++++
>From Carl R. Osterwald <carl_osterwald@nrel.gov>
Date: 27 Nov 1996 17:17:34 GMT
Organization: National Renewable Energy Laboratory
In article <matt-2611961740400001@204.253.173.28> Matt Gieselman,
matt@colorpar.com writes:
>> However, if I print the string to the SOUIX console, I get:
>> <the code>
>> printf("theFile->name = %s.\n", theFile->name);
>> <the result>
>> theFile->name = b2.bucharbfloat_.
>You need to call p2cstr() to convert your Pascal style
>string into a C style string.
Even easier, you can modify the printf() so that it prints a Pascal
string rather than a C string:
printf("theFile->name = %s.\n", theFile->name);
^^ printf assumes it has a C string
printf("theFile->name = %#s.\n", theFile->name);
^^^ printf assumes it has a Pascal string
Remember that the standard C I/O does absolutely no type checking and
just blindly forges ahead regardless of whether or not what you give it
is correct.
+++++++++++++++++++++++++++
>From jpek@genecodes.com (Jeff Pek)
Date: 3 Dec 1996 19:40:04 GMT
Organization: Gene Codes Corp
In article <matt-2611961740400001@204.253.173.28>
matt@colorpar.com (Matt Gieselman) writes:
> > When I inspect the *theFile using the debugger, I find the name field to
> > be the following:
> >
> > theFile->name = "/pb2.buchar"
> >
> > which is what I expect, due to the pascal nomenclature.
> >
> > However, if I print the string to the SOUIX console, I get:
> >
> > <the code>
> > printf("theFile->name = %s.\n", theFile->name);
> >
> > <the result>
> > theFile->name = b2.bucharbfloat_.
>
> You need to call p2cstr() to convert your Pascal style
> string into a C style string. You can do the conversion
> yourself by doing a BlockMove using the first value in
> the Pascal string and putting a null character at the
> end of the string.
Or just use the %#s format to output the pascal string directly.
Of course this will only work on the Mac.
hth - jeff
- ------
Jeff Pek
Development Manager
Gene Codes Corp - Ann Arbor, MI
jpek@genecodes.com
+++++++++++++++++++++++++++
>From blob@ricochet.NOSPAM.net
Date: Tue, 03 Dec 1996 20:32:01 -0700
Organization: (none)
In article <581vmk$plr@kahuna.bizserve.com>, jpek@genecodes.com (Jeff Pek)
wrote:
> Or just use the %#s format to output the pascal string directly.
To print a pascal string in a compiler independent way using printf, use this:
printf("A Pascal string: %.*s .", inPString[0], &inPString[1]);
Since a Pascal string has a length byte followed by the data, you can use
the length byte as the first argument and the data as the second. The
first argument tells the second argument how many characters it will be.
--
(Pointers to other Mac programming web sites at
<http://devworld.apple.com/dev/geeks.html>)
To reply personally, remove the anti-spam "NOSPAM." from the email address
in the header.
---------------------------
>From Tim DeBenedictis <timmyd@best.com>
Subject: Is this a MacOS disk cache bug?
Date: Wed, 04 Dec 1996 09:05:14 -0700
Organization: Best Internet Communications
Hi everybody-
I am cross-posting this question to a number of Mac groups because I
would like to get a better understanding of what is going on, and learn
if there is in fact a problem.
Recently, I've discovered that some files which I've saved seem to
disappear if I have a system crash (or, for that matter, if I just
simply warm- or cold-reboot the machine, without going thru the "safe"
shutdown procedure.) This only happens, tho, if the file I've saved is
small enough to fit entirely into the disk cache.
Here's a sequence of steps that will reproduce this problem every time:
1) Set your disk cache to 1024K and reboot;
2) Launch SimpleText and create a dummy one-sentence text file.
3) Select "Save as..." to save the document, hit the OK button, and make
note of where you saved it.
4) Press cmd-ctrl-pwr to reboot the machine (or pull the plug).
5) Look where you supposedly saved the SimpleText document. On my
machine, the document is gone, every time.
I do NOT encounter this problem, however, if I open, modify, and save a
file which is larger than the disk cache. This leads me to believe that
somehow chached data is not properly getting written to the drive. I
would think that the MacOS disk cache would be designed as a
"write-though" caching scheme to avoid this sort of problem... if anyone
knows otherwise, I would appreciate hearing why.
I am running on a PowerMac 7200/75 with System 7.5.5. I should note
that I don't have an Apple hard drive; I'm using a 2GB HP drive
formatted with FWB's hard disk toolkit software version 1.82. However,
I have a friend with a Performa 6208 with an Apple hard drive and Apple
driver software, and he can reproduce my problem as well.
Thank you very much, and I'd appreciate hearing your suggestions. You
may wish to send e-mail as well as posting, since I do not read all of
these newsgroups very often.
-Tim DeBenedictis
timmyd@best.com
+++++++++++++++++++++++++++
>From rdhw@cus.cam.ac.uk (Robin D.H. Walker)
Date: 4 Dec 1996 17:59:45 GMT
Organization: Queens' College, U of Cambridge, UK
In article <32A5A138.1CE4@best.com>, Tim DeBenedictis <timmyd@best.com> wrote:
>Recently, I've discovered that some files which I've saved seem to
>disappear if I have a system crash (or, for that matter, if I just
>simply warm- or cold-reboot the machine, without going thru the "safe"
>shutdown procedure.) This only happens, tho, if the file I've saved is
>small enough to fit entirely into the disk cache.
This is perfectly normal behaviour and to be expected.
The Mac, along with almost every other advanced operating system,
does not write immediately to hard disk, but defers the write
and returns to the calling program immediately. The write is
deferred on the off-chance that it will be overtaken by another
write to the same area (often true for directories), and to give
a quicker return to the calling program.
Thus it is entirely to be expected that you will lose files if you
crash or do not go through the correct shut-down procedure.
--
Robin Walker (Network Admin), Queens' College, Cambridge, CB3 9ET, GB
rdhw@cam.ac.uk Tel:+44 1223 335528 Fax:+44 1223 335566
+++++++++++++++++++++++++++
>From ericb@pobox.com (Eric Bennett)
Date: 4 Dec 1996 23:15:55 GMT
Organization: Penn State
In article <steve-0412961221210001@in243.inetnebr.com>
steve@mindvision.com (Steve Kiene) writes:
> Apple's cache is not write through. Data is held in the cache until it is
> pushed out or someone calls _FlushFile or _FlushVol. The exact same
> behavior is seen with Speed Doubler, but Speed Doubler 2.0 adds a periodic
> task to write any dirty blocks in the cache to take care of situations
> like this. Plus, Speed Doubler (all versions) flush the cache at various
> places where Apple's cache doesn't. All in the name of safety. :-)
>
> My opinion is that this is first a problem with SimpleText, and second a
> problem with the OS. Programmers should know that you need to flush your
> data to guarantee it is on the disk.
This is not always a bad thing. I accidentally "overwrote" an
important file I had been working on a few weeks ago, and I was able to
recover it by doing a hard reboot since the overwrite was still in
cache. :-)
--
-Eric Bennett ( ericb@pobox.com ; http://www.pobox.com/~ericb )
I took a speed reading course and read War and Peace in twenty minutes.
It involves Russia.
-Woody Allen
+++++++++++++++++++++++++++
>From steve@mindvision.com (Steve Kiene)
Date: Wed, 04 Dec 1996 12:21:21 -0500
Organization: MindVision Software
In article <32A5A138.1CE4@best.com>, timmyd@best.com wrote:
> Recently, I've discovered that some files which I've saved seem to
> disappear if I have a system crash (or, for that matter, if I just
> simply warm- or cold-reboot the machine, without going thru the "safe"
> shutdown procedure.) This only happens, tho, if the file I've saved is
> small enough to fit entirely into the disk cache.
>
> Here's a sequence of steps that will reproduce this problem every time:
>
> 1) Set your disk cache to 1024K and reboot;
> 2) Launch SimpleText and create a dummy one-sentence text file.
> 3) Select "Save as..." to save the document, hit the OK button, and make
> note of where you saved it.
> 4) Press cmd-ctrl-pwr to reboot the machine (or pull the plug).
> 5) Look where you supposedly saved the SimpleText document. On my
> machine, the document is gone, every time.
>
> I do NOT encounter this problem, however, if I open, modify, and save a
> file which is larger than the disk cache. This leads me to believe that
> somehow chached data is not properly getting written to the drive. I
> would think that the MacOS disk cache would be designed as a
> "write-though" caching scheme to avoid this sort of problem... if anyone
> knows otherwise, I would appreciate hearing why.
Apple's cache is not write through. Data is held in the cache until it is
pushed out or someone calls _FlushFile or _FlushVol. The exact same
behavior is seen with Speed Doubler, but Speed Doubler 2.0 adds a periodic
task to write any dirty blocks in the cache to take care of situations
like this. Plus, Speed Doubler (all versions) flush the cache at various
places where Apple's cache doesn't. All in the name of safety. :-)
My opinion is that this is first a problem with SimpleText, and second a
problem with the OS. Programmers should know that you need to flush your
data to guarantee it is on the disk.
Before anyone jumps up and screams "Why isn't the cache write through",
consider performance. A true write-though cache would kill performance.
However, Speed Doubler 2.0 has some nice (IMHO) tricks to get the best of
both worlds. Caches in the MS-DOS and Windows world are not write through
either. In fact, they are even more agressive/dangerous than Apple's
cache.
Steve Kiene
MindVision Software
Co-author of Speed Doubler
+++++++++++++++++++++++++++
>From "Eric Schlegel" <ericsc@apple.com>
Date: 4 Dec 96 23:18:51 -0800
Organization: Apple Computer, Inc.
Steve Kiene <steve@mindvision.com> wrote:
> In article <32A5A138.1CE4@best.com>, timmyd@best.com wrote:
>
> > Recently, I've discovered that some files which I've saved seem to
> > disappear if I have a system crash (or, for that matter, if I just
> > simply warm- or cold-reboot the machine, without going thru the "safe"
> > shutdown procedure.) This only happens, tho, if the file I've saved is
> > small enough to fit entirely into the disk cache.
> >
> My opinion is that this is first a problem with SimpleText, and second a
> problem with the OS. Programmers should know that you need to flush your
> data to guarantee it is on the disk.
In fact, this *is* a bug in SimpleText. A call to FlushVol was added to the
sources in July 1996, but that was after the latest released version of
SimpleText (1.3.1) was built. When SimpleText 1.4 is available you
shouldn't see this occur any more.
-eric
- ---------------------------------------------------------------------
Eric Schlegel ** High-level Toolbox, Apple Computer ** ericsc@apple.com
+++++++++++++++++++++++++++
>From woody@alumni.caltech.edu (William Edward Woody)
Date: Thu, 05 Dec 1996 02:20:25 -0800
Organization: In Phase Consulting
alain@cs.uchicago.edu (Alain Aslag Roy) wrote:
> rdhw@cam.ac.uk (Robin Walker) wrote:
> > Tim DeBenedictis <timmyd@best.com> wrote:
> >
> > >Recently, I've discovered that some files which I've saved seem to
> > >disappear if I have a system crash (or,
>
> > This is perfectly normal behaviour and to be expected.
>
> I suggest that people interested in disk-caches and lost data look at:
>
> <http://www.be.com/aboutbe/benewsletter/Issue51.html#Insight>
While the technique of Journaling is interesting, it only assures that
the overall structure of the file system is preserved across a crash.
It does not preserve the integrety of the contents of files whose data
still hasn't been flushed to the hard disk: that is, the same problem
being discussed (lost file data) will still exist.
The short answer is that yes, this is normal behaviour and is to
be expected. Most high performance systems (including mainframes
and minis) use a similar cache scheme (in principle) to the
Macintosh in order to reduce the I/O demand on the hard disk--they get
around the problem of insuring file system integrety across a system
crash by trying their damnest not to crash. :-)
- Bill
--
William Edward Woody * In Phase Consulting * woody@alumni.caltech.edu
+++++++++++++++++++++++++++
>From alain@cs.uchicago.edu (Alain Aslag Roy)
Date: Thu, 5 Dec 1996 02:22:07 GMT
Organization: The Anti-Weather Forecasters Coalition
In article <584e6h$b6@lyra.csx.cam.ac.uk>, rdhw@cam.ac.uk (Robin Walker) wrote:
> In article <32A5A138.1CE4@best.com>, Tim DeBenedictis <timmyd@best.com>
wrote:
>
> >Recently, I've discovered that some files which I've saved seem to
> >disappear if I have a system crash (or,
...
> This is perfectly normal behaviour and to be expected.
I suggest that people interested in disk-caches and lost data look at:
<http://www.be.com/aboutbe/benewsletter/Issue51.html#Insight>
-alain
---------------------------
>From 100276.1254@compuserve.com
Subject: LEX and YACC on the Mac
Date: Sun, 08 Dec 1996 11:21:06 -0600
Organization: Deja News Usenet Posting Service
Hi,
I'm looking for shareware equivalents to LEX and YACC for the Mac.
Thanks in advance for your help,
Pierre Bernard.
- -----------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
+++++++++++++++++++++++++++
>From mick@emf.net (Mick Foley)
Date: 8 Dec 1996 21:13:14 GMT
Organization: Raindance
In article <849878715.15989@dejanews.com>, 100276.1254@compuserve.com wrote:
>Hi,
>
>I'm looking for shareware equivalents to LEX and YACC for the Mac.
>
>Thanks in advance for your help,
>Pierre Bernard.
>-------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
If you are a CodeWarrior person, look in the third party tools folder.
There are plug in versions of both flex and bison. I've just played around
a little with them, but they work. The actual "compilers" are FSF stuff -
no charge. The prefs panels to control them are shareware (about $10 -
$20).
Enjoy --
Mick
--
- -------------------------------------------------------------------
Mick Foley "Remember, no matter where
mick@emf.net you go, there you are."
- -------------------------------------------------------------------
+++++++++++++++++++++++++++
>From cbarron3@ix.netcom.com
Date: Sun, 8 Dec 1996 23:54:31 -0500
Organization: Netcom
<100276.1254@compuserve.com> wrote:
> Hi,
>
> I'm looking for shareware equivalents to LEX and YACC for the Mac.
>
> Thanks in advance for your help,
> Pierre Bernard.
> -------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
There are also drag and drops of flex 2.5.1 and byacc 1.9 someplace in
the large ftp archives.
---------------------------
>From Mephisto <mwehner@lander.es>
Subject: MacsBug - Memory
Date: Wed, 04 Dec 96 22:32:09 -0500
Organization: Lander Internet
Hi!
I just read the MacsBug guide.
The people there say MacsBug needs about 140k of RAM.
I however saw in Symbionts (a control panel that shows how much RAM is
used up by each control panel/extension) something more like 500-600k!
That's a little bit more! :)
I just wanted to know if anyone else has some RAM information about
MacsBug 6.5.3
Thanks!
Mephisto (mwehner@lander.es)
+++++++++++++++++++++++++++
>From blob@ricochet.NOSPAM.net
Date: Thu, 05 Dec 1996 07:18:43 -0700
Organization: (none)
In article <961204222914-mwehner@lander.es>, mwehner@lander.es wrote:
> Hi!
>
> I just read the MacsBug guide.
> The people there say MacsBug needs about 140k of RAM.
> I however saw in Symbionts (a control panel that shows how much RAM is
> used up by each control panel/extension) something more like 500-600k!
> That's a little bit more! :)
I assume that you mean "MacsBug Reference and Debugging Guide for Macsbug
version 6.2" published by Addison-Wesley. Since version 6.2, Macsbug has
had many features added to it. Macsbug 6.5.3 now supports the PowerPC
architecture, has twice has many commands, has extensive help, and other
improvements. If Symbionts is reporting 500-600k of RAM being used, it
isn't lying.
Macsbug 6.5.3 uses much more RAM than version 6.2, but it also does much
more. Unfortunately, there is no way to cut down the memory usage of
Macsbug by very much.
--
(Pointers to other Mac programming web sites at
<http://devworld.apple.com/dev/geeks.html>)
To reply personally, remove the anti-spam "NOSPAM." from the email address
in the header.
+++++++++++++++++++++++++++
>From jumplong@aol.com
Date: 7 Dec 1996 03:58:30 GMT
Organization: AOL http://www.aol.com
Mephisto wrote:
>I just read the MacsBug guide. The people there say MacsBug
>needs about 140k of RAM. I however saw in Symbionts (a control
>panel that shows how much RAM is used up by each control
>panel/extension) something more like 500-600k! That's a little
>bit more! :) I just wanted to know if anyone else has some RAM
>information about MacsBug 6.5.3
The MacsBug guide was written for MacsBug 6.2. MacsBug 6.5.x does eat
quite a bit more memory, but it also supports PowerPC Macintosh systems
and has many, many enhancements beyond what you got in version 6.2.
How much memory it uses can be reduced some by editing out things you
don't need with ResEdit. However, you never know what things you'll need
to debug a crash, so what to remove is a hard decision...
- Jim Luther
---------------------------
>From ianm@mmcorp.com (Ian McCall)
Subject: Open Tranport: Why no T_CONNECT signal?
Date: Fri, 29 Nov 1996 14:18:11 +0000
Organization: The MultiMedia Corporation
Hi.
I'm trying to open an FTP connection using Open Transport. I make the call
to endPoint->Connect() and it comes back with kOTNoError as expected.
However, I then expect to get a T_CONNECT signal at some point, and I
never do. The very first thing that comes back to me is a T_DATA signal,
with the incoming data being the FTP server's Ready prompt.
Why is this? Surely I must have successfully opened a connection if I get
back a ready prompt?
Any help on this is much appreciated.
Cheers,
Ian
+++++++++++++++++++++++++++
>From chrisn+@cmu.edu (Chris Newman)
Date: Mon, 02 Dec 1996 19:37:58 -0800
Organization: Altopia Corp. - Affordable Usenet Access - http://www.alt.net
In article <ianm-2911961418110001@194.70.62.242>, ianm@mmcorp.com (Ian
McCall) wrote:
>I'm trying to open an FTP connection using Open Transport. I make the call
>to endPoint->Connect() and it comes back with kOTNoError as expected.
>
>However, I then expect to get a T_CONNECT signal at some point, and I
>never do. The very first thing that comes back to me is a T_DATA signal,
>with the incoming data being the FTP server's Ready prompt.
>
>Why is this? Surely I must have successfully opened a connection if I get
>back a ready prompt?
Is your Endpoint in Asynchronous mode?
+++++++++++++++++++++++++++
>From ianm@mmcorp.com (Ian McCall)
Date: Tue, 03 Dec 1996 17:24:58 +0000
Organization: The MultiMedia Corporation
> Is your Endpoint in Asynchronous mode?
Yep.
Cheers,
Ian
---------------------------
>From jpurlia@qualcomm.com (John Purlia)
Subject: PBHGetVInfo return the wrong number of items in a root directory?
Date: Mon, 25 Nov 1996 11:12:08 -0800
Organization: QUALCOMM, Inc.
Can anyone tell me how to easily get the accurate number of items in a
root directory? Calling PBHGetVInfo on a volume seems to return only in
ioVNmFls the number of _files_ in the directory, not the combined number
of files and folders as is the case in the ioDrNmFls field when calling
PBGetCatInfo for a directory.
Or, after calling PBHGetVInfo do I then have to call PBGetCatInfo to get
the info I need?
Thanks!
-- John
...........................................................................
John Purlia, Staff Engineer :
Eudora New Product Research Guy : "I hate repagination"
QUALCOMM, Inc. : -- me, after using Word 6
jpurlia@qualcomm.com : for any complex document
+++++++++++++++++++++++++++
>From David Gillies <daggilli@vader.brad.ac.uk>
Date: Thu, 28 Nov 1996 16:50:31 +0000
Organization: University of Bradford
John Purlia wrote:
>
> Can anyone tell me how to easily get the accurate number of items in a
> root directory? Calling PBHGetVInfo on a volume seems to return only in
> ioVNmFls the number of _files_ in the directory, not the combined number
> of files and folders as is the case in the ioDrNmFls field when calling
> PBGetCatInfo for a directory.
>
> Or, after calling PBHGetVInfo do I then have to call PBGetCatInfo to get
> the info I need?
>
If you know the reference number of the disk you want then just use
PBGetCatInfo with 2 (fsRtDirID) in the ioDirID field. If you want to
return the number of objects of a given type i.e. files *or* folders
then you need to be a bit cleverer. The only way I could think of to
do this was to index through the directory checking ioFlAttrib&0x10
to see if the entry was a folder. But if you are looking at the root
directory (i.e. parID=2) then you need to be even more careful if you
only want *visible* items. You can't just check ioFlUsrWds.fdFlags&
fInvisible since Apple have thoughtfully ignored this for the Trash,
Temporary Items and Desktop folders. "Why?", I hear you cry. God only
knows, but it is a *right pain* and very, very annoying. Can you hear
me Mr. Anderson?
To avoid this silliness, you can use FindFolder to locate the three
offending folders and then reject them if you get these IDs back from
PBGetCatInfo, but it seems a bit lame to have to do this.
--
______________________________________________________________________
David A. G. Gillies (daggilli@vader.brad.ac.uk)
University of Bradford, Bradford, West Yorkshire, England
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
+++++++++++++++++++++++++++
>From jumplong@aol.com
Date: 30 Nov 1996 15:36:07 GMT
Organization: AOL http://www.aol.com
John Purlia wrote:
>Can anyone tell me how to easily get the accurate number of
>items in a root directory? Calling PBHGetVInfo on a volume
>seems to return only in ioVNmFls the number of _files_ in the
>directory, not the combined number of files and folders as is
>the case in the ioDrNmFls field when calling PBGetCatInfo for a
>directory.
>
>Or, after calling PBHGetVInfo do I then have to call
>PBGetCatInfo to get the info I need?
Yes, PBHGetVInfo returns just the number of files (not directories) in
ioVNmFls and then, only if you *don't* pass PBHGetVInfo a working
directory number. If you pass a working directory number as the ioVRefNum
parameter, PBHGetVInfo returns the number of files in the directory
refered to by working directory.
If you need the number of files and directories in a given directory,
you'll have to use PBGetCatInfo and index through the directory entries to
get an accurate count.
- Jim Luther
+++++++++++++++++++++++++++
>From a (a)
Date: 3 Dec 1996 23:31:16 GMT
Organization: a
In article <329DC2D7.4EA2@vader.brad.ac.uk>, David Gillies
<daggilli@vader.brad.ac.uk> wrote:
> John Purlia wrote:
> >
> > Can anyone tell me how to easily get the accurate number of items in a
> > root directory? Calling PBHGetVInfo on a volume seems to return only in
> > ioVNmFls the number of _files_ in the directory, not the combined number
> > of files and folders as is the case in the ioDrNmFls field when calling
> > PBGetCatInfo for a directory.
> >
> > Or, after calling PBHGetVInfo do I then have to call PBGetCatInfo to get
> > the info I need?
> >
> If you know the reference number of the disk you want then just use
> PBGetCatInfo with 2 (fsRtDirID) in the ioDirID field. If you want to
Use PBGetCatInfo to index the root directory directly. Don't trust
PBGetCatInfo to return the correct number of items in the directory. HFS
is cool, but some of the other file systems such as unix, OS/400, or DOS
don't keep track of the number of directory items correctly.
Sorry for the painful news,
Robert Thurman
Shokwave Software
www.shokwave.com
---------------------------
>From mschwa4259@aol.com
Subject: Put file without Dialog Box
Date: 7 Dec 1996 22:40:39 GMT
Organization: AOL http://www.aol.com
Hi,
I'm curious how you could creat a file, without having to call
StandardPutFile() to get a reply. My program has a scratch datafile and I
really don't want to have a diaog box pop up everytime I launch. I'm sure
it's easy I just don;t know how to do it.
Thanks,
Matt
+++++++++++++++++++++++++++
>From jude@smellycat.com (Jude Giampaolo)
Date: Sat, 07 Dec 1996 18:01:21 -0500
Organization: CyberDrugs
In article <19961207224000.RAA25146@ladder01.news.aol.com>,
mschwa4259@aol.com wrote:
> I'm curious how you could creat a file, without having to call
> StandardPutFile() to get a reply. My program has a scratch datafile and I
> really don't want to have a diaog box pop up everytime I launch. I'm sure
> it's easy I just don;t know how to do it.
Just build an FSSpec using FSMakeFSSpec instead of using the file spec
returned in the standard file reply.....
--
Jude Charles Giampaolo 'I was lined up for glory, but the
jcg161@psu.edu tickets sold out in advance'
jude@smellycat.com http://prozac.cwru.edu/jude/JudeHome.html
+++++++++++++++++++++++++++
>From squires@crl.com (Scott Squires)
Date: Sat, 07 Dec 1996 17:56:59 -0800
Organization: Puffin Designs
In article <19961207224000.RAA25146@ladder01.news.aol.com>,
mschwa4259@aol.com wrote:
>Hi,
>
>I'm curious how you could creat a file, without having to call
>StandardPutFile() to get a reply. My program has a scratch datafile and I
>really don't want to have a diaog box pop up everytime I launch. I'm sure
>it's easy I just don;t know how to do it.
>
Create a temp file in the Temporary Folder. Inside Mac:Files should cover
this.
Create a FFSpec and just create it.
Inside Mac is also avialable at Apple's Web site.
-scott
Scott Squires "Insert funny stuff here"
squires@crl.com
ScottSquir@aol.com
---------------------------
>From "Zane H. Healy" <healyzh@ix.netcom.com>
Subject: Question about "The Debugger"
Date: Thu, 05 Dec 1996 19:26:07 -0800
Organization: Netcom
Hi,
I seem to have run into a problem with a program that I've been writing,
that the CW 9 Debugger can't handle. So I'm wondering what peoples
opinions of "The Debugger" from "Jasik Designs" is. Since in order to
get it I'd end up spending the money I'd intended on spending on
"Resourcerer" it would be nice to know which of the two people think is
the better investment.
Also how well does "The Debugger" handle running with "Ram Doubler" in
operation? I know "Ram Doubler" causes some problems with CW.
Thanks for your time,
Zane
--
| Zane H. Healy | UNIX Systems Adminstrator |
| healyzh@ix.netcom.com (primary) | Linux Enthusiast |
| healyzh@holonet.net (alternate) | Mac Programmer |
+----------------------------------+---------------------------+
| For Empire of the Petal Throne, and Traveller Role Playing |
| see http://www.dragonfire.net/~healyzh/ |
+++++++++++++++++++++++++++
>From awiner@oracle.com (Adam Winer)
Date: Thu, 05 Dec 1996 21:17:15 -0800
Organization: Oracle Corporation
In article <32A79210.5AAB@ix.netcom.com>, "Zane H. Healy"
<healyzh@ix.netcom.com> wrote:
> Hi,
> I seem to have run into a problem with a program that I've been writing,
> that the CW 9 Debugger can't handle. So I'm wondering what peoples
> opinions of "The Debugger" from "Jasik Designs" is. Since in order to
> get it I'd end up spending the money I'd intended on spending on
> "Resourcerer" it would be nice to know which of the two people think is
> the better investment.
Hard to say. They're both nice to have.
Once you get past the (IMHO) sometimes obtuse and obscure interface,
Jasik's Debugger is an absolutely wonderful and incredibly powerful
tool. If you're debugging drag-and-drop code, CDEF's, or anything
else that MW Debugger can't really handle, it's a lifesaver. The
technical support is also superb.
Personally, I find the combination of the MW Debugger and MacsBug
handle 99% of my debugging needs. But if that 1% is a critical
bug that prevents you from shipping your product...
> Also how well does "The Debugger" handle running with "Ram Doubler" in
> operation? I know "Ram Doubler" causes some problems with CW.
To the best of my knowledge, it doesn't work with RamDoubler,
though it does work with SpeedDoubler. (At least, that's how
it was about 6 months ago - it might have changed). If you
have so little memory that you need RamDoubler, you're best off
not spending that money on either of these two products - get
yourself some memory. Developing with less than 32MB is almost
hopeless.
-- Adam Winer
awiner@us.oracle.com
+++++++++++++++++++++++++++
>From al@crucible.powertools.com (Al Evans)
Date: 6 Dec 1996 08:08:08 -0600
Organization: Powertools, Austin, Texas
In article <32A79210.5AAB@ix.netcom.com>,
Zane H. Healy <healyzh@ix.netcom.com> wrote:
>So I'm wondering what peoples
>opinions of "The Debugger" from "Jasik Designs" is. Since in order to
>get it I'd end up spending the money I'd intended on spending on
>"Resourcerer" it would be nice to know which of the two people think is
>the better investment.
Hmmm, "better investment" -- I find BOTH of them essential.
I switched to Jasik's as my general-purpose debugger several months ago,
largely because I got tired of seeing the words "register - not available".
It took a few days to get used to, and a couple of hours dorking with
MPW to get a script that would build the ".dsi" files required for
source-level debugging (I HATE writing MPW shell scripts, but that's
another story). "Keep the cheat sheet near you at all times," is
Steve's advice, and he's right.
The best things about it, in my opinion, are
1) It has never taken more than 12 hours to get a problem solved, and
most questions are answered in one quick phone call or email. You'll
have a hard time finding anything it can't do, though occasionally, you
may have a hard time figuring out HOW to do something without asking
Steve.
2) Command-shift-U shows a dump of all stack frames with all local
variables. In many cases, this makes it trivial to find out how you
got to your current untenable situation.
3) Command-clicking on a source window switches it back and forth between
source and mixed source and assembly. Great for setting breakpoints in
the middle of compound statements.
My debugging needs tend to be moderate, and I've barely scratched the
surface of The Debugger's capabilities. Even so, I wouldn't be without
it.
--Al Evans--
--
|||| Al Evans -- al@powertools.com -- proud of Graphic Elements Release 3 ||||
==== A new standard for high-performance interactive Macintosh graphics ====
==== Available from mac.archive.umich.edu and mirrors in ====
|||| /mac/development/libraries/graphicelements3.0.sit.hqx ||||
---------------------------
>From James Munroe <eccles@astral.magic.ca>
Subject: QuickTime Musical Instruments?
Date: Sun, 01 Dec 1996 11:39:06 +0000
Organization: Total Net
I have looked through the Toolbox Assistant and my CodeWarrior 10 header
files and can find no function prototypes or other info. showing the internal
structure of QuickTime Musical Instruments or how to access them;
neither in the QuickTime Components, nor in <MIDI.h>. Similarly, I have
found nothing so far in this newgroup nor in
comp.sys.mac.programmer.codewarrior, though I will be sending this
question to them as well.
if anyone has these header files or can tell me where to get them, please
email me at <eccles@astral.magic.ca> or <James_Munroe@goodmedia.com>.
I'd really appreciate it.
Cheers,
James.
+++++++++++++++++++++++++++
>From bitzm@apple.com (Mike Bitz)
Date: Mon, 02 Dec 1996 14:50:42 -0700
Organization: Apple Computer, Inc.
In article <32A16E5A.7647@astral.magic.ca>, James Munroe
<eccles@astral.magic.ca> wrote:
> I have looked through the Toolbox Assistant and my CodeWarrior 10 header
> files and can find no function prototypes or other info. showing the internal
> structure of QuickTime Musical Instruments or how to access them;
QTMA function prototypes are found in QuickTimeMusic.h. Be sure to grab
the latest QuickTime 2.5 headers and libraries from:
<http://quicktime.apple.com/dev/tool.html>
Also, David Van Brink has provided oodles of QTMA information:
<http://www.srm.com/qtma/>
-Mike
+++++++++++++++++++++++++++
>From David Reiss <reiss@astro.washington.edu>
Date: Tue, 03 Dec 1996 13:51:56 -0800
Organization: http://www.astro.washington.edu/reiss
I'm also interested in trying to play with this stuff, but it
seems that the link to the QT 2.5 interfaces on the page you
mention below is invalid. Where can I get at the darn things!?
<ftp://ftp.info.apple.com/dts/quicktime
is gone!
THanks.
-David
Mike Bitz wrote:
>
> In article <32A16E5A.7647@astral.magic.ca>, James Munroe
> <eccles@astral.magic.ca> wrote:
>
> > I have looked through the Toolbox Assistant and my CodeWarrior 10 header
> > files and can find no function prototypes or other info. showing the internal
> > structure of QuickTime Musical Instruments or how to access them;
>
> QTMA function prototypes are found in QuickTimeMusic.h. Be sure to grab
> the latest QuickTime 2.5 headers and libraries from:
>
> <http://quicktime.apple.com/dev/tool.html>
>
> Also, David Van Brink has provided oodles of QTMA information:
>
> <http://www.srm.com/qtma/>
>
> -Mike
+++++++++++++++++++++++++++
>From sgraff@apple.com (Steve Graff)
Date: Fri, 06 Dec 1996 11:51:35 -0800
Organization: Apple Computer, Inc.
In article <32A4A0FC.4513@astro.washington.edu>, David Reiss
<reiss@astro.washington.edu> wrote:
> I'm also interested in trying to play with this stuff, but it
> seems that the link to the QT 2.5 interfaces on the page you
> mention below is invalid. Where can I get at the darn things!?
>
> <ftp://ftp.info.apple.com/dts/quicktime
>
> is gone!
They can also be found on the QuickTime FAQ web page:
<http://www.QuickTimeFAQ.org/developer/>
--
Steve Graff
Developer Support
Apple Computer, Inc.
sgraff@apple.com
---------------------------
>From Shelley Walsh <Shelley@Shells.demon.co.uk>
Subject: Screen Redrawing Command Wanted
Date: Sun, 01 Dec 1996 20:48:18 GMT
Organization: (none)
Can anybody tell me what the Mac Toolbox command to redraw the screen
after you have changed something. Thanks in advance for any help you can
give me.
+++++++++++++++++++++++++++
>From Shelley Walsh <Shelley@Shells.demon.co.uk>
Date: Wed, 04 Dec 1996 11:03:12 GMT
Organization: (none)
Thanks to everyone who responded to this. I'm okay now. I used
InvalRect() and it worked. It seems like I used something different the
last time I did this, but I'm in the process of moving and my Inside Mac
book is still at my old house. Anyway, thanks everybody.
+++++++++++++++++++++++++++
>From David Gillies <daggilli@vader.brad.ac.uk>
Date: Wed, 04 Dec 1996 16:38:11 +0000
Organization: University of Bradford
Shelley Walsh wrote:
>
> Can anybody tell me what the Mac Toolbox command to redraw the screen
> after you have changed something. Thanks in advance for any help you can
> give me.
Ain't no such thing in general - apps handle their own drawing. You
might be able to fake it by setting the port to the window you want
to update and calling PaintOne().
--
______________________________________________________________________
David A. G. Gillies (daggilli@vader.brad.ac.uk)
University of Bradford, Bradford, West Yorkshire, England
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
---------------------------
>From jbk3@acpub.duke.edu (Jeff Kolesky)
Subject: Scrolling
Date: Wed, 04 Dec 1996 00:44:22 -0500
Organization: Duke University, Durham, NC, USA
I am working on a game with a constant scrolling background that can
change speeds when the player
moves the mouse. Currently I am using two offscreen Gworlds and simply
copybitting the current
screen rect to the work port, adding sprites to that, and then blitting to
the screen. Then the rect in the
scrolling background moves up and the process starts again. Any ideas on
a better way of doing this?
Thanks,
Jeff
+++++++++++++++++++++++++++
>From karlbunker@aol.com
Date: 4 Dec 1996 18:27:56 GMT
Organization: AOL http://www.aol.com
> I am working on a game with a constant scrolling background that can
> change speeds when the player moves the mouse. Currently I am using two
> offscreen Gworlds and simply copybitting the current screen rect to the
> work port, adding sprites to that, and then blitting to the screen.
> Then the rect in the scrolling background moves up and the process
> starts again. Any ideas on a better way of doing this?
Yeah; check out the SpriteWorld 2 animation library. It does what you want
and much more.
Karl Bunker
KarlBunker@aol.com
http://users.aol.com/karlbunker/
SpriteWorld 2 Web page:
http://users.aol.com/spritewld2/
+++++++++++++++++++++++++++
>From antispam@apple.com (Cary Farrier)
Date: Wed, 04 Dec 1996 12:37:03 -0800
Organization: Apple Computer, Inc.
In article <andrew-0412960739140001@pat2.metrowerks.com>,
andrew@metrowerks.com (Andrew R. Southwick) wrote:
> (5) DrawSprockets can give you a "back buffer" (which is the offscreen
> world that you build a frame into before copying it to the screen) and
> then get that back buffer to the screen very quickly (if the proper
> hardware is available). Otherwise, it degenerates to quickdraw, which
> is what you are doing anyway. Well worth looking into; it also does
> a lot of other cool things. Check out Apple's Sprockets web page at:
> <http://www.devworld.apple.com>. In the Hot Technologies list along
> the left side of the screen, choose the Games link.
Actually, DSp only uses CopyBits if the back buffer is not the same
depth as the display, a situation that a program would have to
setup explicitly -- it wouldn't happen unless the program requested it.
The hardware in use really isn't a factor in the decision.
-> Cary
--
- --------------------------------------------------------------------
Cary Farrier, aka Mr. Draw Sprocket
Software Engineer, Apple Game Technology Group
farrier@apple.com
Visit the Apple Games Website at <http://dev.info.apple.com/games>
---------------------------
>From nfranke@pacbell.net (Norman Franke)
Subject: Sound Input Manager
Date: Fri, 29 Nov 1996 14:21:24 -0800
Organization: Infinity City
I'm recording sounds using the Sound Input Manager using double buffering.
I've noticed there are clicks between the buffers. Is there some multiple
to make the buffers so this won't happen? I seem to recall something to
this effect posted here...
Thanks!
--
Norman Franke
nfranke@pacbell.net
+++++++++++++++++++++++++++
>From jaeho@xs4all.nl (Jae Ho Chang)
Date: Sat, 30 Nov 1996 21:16:02 +0100
Organization: eMusicas
> I'm recording sounds using the Sound Input Manager using double buffering.
> I've noticed there are clicks between the buffers. Is there some multiple
> to make the buffers so this won't happen? I seem to recall something to
> this effect posted here...
Hi Norman, did you turn on the continuous recording feature (using
siContinuos selector with SPBSetDeviceInfo()) ?
PS. I cannot remeber the function name exactly.
Jae Ho Chang :-)
--
Sound from Chaos?
Visit Chaotic Synthesis Home Page
<http://www.xs4all.nl/~jaeho/ChaoticSynth/>
Looking for cool Macintosh note utility?
Check out FinderNote the amazing note utility
<http://www.xs4all.nl/~jaeho/FinderNote/>
+++++++++++++++++++++++++++
>From Jackson Software Development <development@jacksoncorp.com>
Date: 2 Dec 1996 15:29:32 GMT
Organization: Jackson Software
In article <nfranke-ya023480002911961421240001@pbinews.pacbell.net>
Norman Franke, nfranke@pacbell.net writes:
>I'm recording sounds using the Sound Input Manager using double buffering.
>I've noticed there are clicks between the buffers. Is there some multiple
>to make the buffers so this won't happen? I seem to recall something to
>this effect posted here...
There's a selector that you can send to SPBGetDeviceInfo (). I believe
it's
siBufferSize, or something like that. Your buffers should be an integer
multiple of that.
Darrin
+++++++++++++++++++++++++++
>From franke1@llnl.gov (Norman Franke)
Date: Mon, 02 Dec 1996 08:59:46 -0800
Organization: Lawrence Livermore National Laboratory
In article <jaeho-3011962116030001@ztm07-04.dial.xs4all.nl>,
jaeho@xs4all.nl (Jae Ho Chang) wrote:
> Hi Norman, did you turn on the continuous recording feature (using
> siContinuos selector with SPBSetDeviceInfo()) ?
Actually, no I didn't. It wasn't clear what that did from reading MPTA and
it did take a while to find it in IM: Sound. However, that does seem to
work better. Thanks.
--
Norman Franke
franke1@llnl.gov
+++++++++++++++++++++++++++
>From franke1@llnl.gov (Norman Franke)
Date: Mon, 02 Dec 1996 09:02:27 -0800
Organization: Lawrence Livermore National Laboratory
In article <57usks$i1k@kirin.wwa.com>, Jackson Software Development
<development@jacksoncorp.com> wrote:
> There's a selector that you can send to SPBGetDeviceInfo (). I believe
> it's
> siBufferSize, or something like that. Your buffers should be an integer
> multiple of that.
Ah, thanks. It's called siDeviceBufferInfo.
--
Norman Franke
franke1@llnl.gov
---------------------------
>From eloni19@mail.idt.net (ZiM)
Subject: SpriteWorld 2
Date: Thu, 05 Dec 1996 18:07:22 -0500
Organization: n/a
Greets,
I have just gotten a copy of SpriteWorld 2, and I have run into a major
pitfall. In a small app that I was testing with, I ran some code, and when
i was stepping through it with the debugger, the whole machine froze - no
mouse movement, no MacsBug, nothing.
here's the troublesome code:
SimpleSpriteP = gSimpleSpriteArray[spriteNum];
SWAddSprite(SpriteLayerP, SimpleSpriteP);
SWSetSpriteLocation(SimpleSpriteP, horizLoc, vertLoc); /* This is
the line that froze everything up */
SWSetSpriteDrawProc(SimpleSpriteP, gSpriteDrawProc);
BTW - i'm using symantic 7.0.5
any input would be greatly appreciated
thank you, in advance
Pete Lukow
eloni19@mail.idt.net
-0-ZiM-0-
+++++++++++++++++++++++++++
>From eloni19@mail.idt.net (ZiM)
Date: Thu, 05 Dec 1996 19:47:39 -0500
Organization: n/a
In article <eloni19-0512961807220001@hingham109.pcix.com>,
eloni19@mail.idt.net (ZiM) wrote:
> Greets,
> I have just gotten a copy of SpriteWorld 2, and I have run into a major
> pitfall. In a small app that I was testing with, I ran some code, and when
> i was stepping through it with the debugger, the whole machine froze - no
> mouse movement, no MacsBug, nothing.
>
> here's the troublesome code:
>
> SimpleSpriteP = gSimpleSpriteArray[spriteNum];
> SWAddSprite(SpriteLayerP, SimpleSpriteP);
> SWSetSpriteLocation(SimpleSpriteP, horizLoc, vertLoc); /* This is
> the line that froze everything up */
> SWSetSpriteDrawProc(SimpleSpriteP, gSpriteDrawProc);
>
>
> BTW - i'm using symantic 7.0.5
>
> any input would be greatly appreciated
>
> thank you, in advance
> Pete Lukow
> eloni19@mail.idt.net
> -0-ZiM-0-
OK, I fiddled around with the code s'more and i finally got it so that it
no loger crashed, apparently I was handing it a frame that didn't exist.
Anyway - another question, now when it attempts to use the
SWStdSpriteDrawProc, i get a bus error for no apparent reason. thoughts?
thanks =)
-0-ZiM-0-
+++++++++++++++++++++++++++
>From karlbunker@aol.com
Date: 8 Dec 1996 15:39:34 GMT
Organization: AOL http://www.aol.com
eloni19@mail.idt.net (ZiM) sez:
> Anyway - another question, now when it attempts to use the
> SWStdSpriteDrawProc, i get a bus error for no apparent reason.
> thoughts?
Unfortunately, that could be any one of a number of possible errors in
your code. A few that spring to mind first are: perhaps you didn't lock
the Sprite, or the Sprite was never added to a Layer, or the Layer never
added to the SpriteWorld.
Karl Bunker
KarlBunker@aol.com
http://users.aol.com/karlbunker/
SpriteWorld 2 Web page:
http://users.aol.com/spritewld2/
---------------------------
>From ram@terminus.cs.umb.edu (Robert A. (Bob) Morris)
Subject: Symantec C++ fstreams write unreadable files
Date: 22 Nov 1996 16:49:10 -0500
Organization: University of Massachusetts at Boston
I'm programming in Symantec C++ 7.0 on a 68k system, 8.0 on a power
mac. OS is System 7.5. In either case, I open an fstream fro writing
with calls like
fstream logStream;
logStream.open("log.txt");
and write with logStream <<
There are no I/O errors and the expected characters are in fact
written in the file. However, neither TeachText nor SimpleText are
able to open the file. Word 5.1, however, does so if I ask it to open
"All Files" instead of just "Readable" files.
So what's keeping me from reading these plain text files with light
weight readers?
Thanks for replies by mail
Bob Morris
ram@cs.umb.edu
+++++++++++++++++++++++++++
>From "Thomas L. Ferrell" <ferrelltl@ornl.gov>
Date: 24 Nov 1996 22:49:36 GMT
Organization: Oak Ridge National Lab
Uh oh! I was off-base on this one. Bob's code he sent is below. Can
anyone help? I couldn't get SimpleText to open the file either! thx, tom
This code exhibits the problem:
#include <iostream.h>
#include <fstream.h>
void main()
{
ofstream foo;
foo.open("foo.txt");
foo << "Hello" << endl;
foo.close();
}
The same thing happens if foo is an fstream instead of an ofstream.
Maybe there is some compiler option I've got set wrong, but I can't
see what it is, nor can I find anything in Symantec's docs.
+++++++++++++++++++++++++++
>From johnm@buttenet.com (Johnathon McAlister)
Date: Fri, 29 Nov 1996 15:59:56 -0700
Organization: Home
Are the file type and creator correct?
--
Johnathon McAlister
Senior Programmer, MT Lottery (days)
Mac and Internet Consultant (evenings)
johnm@buttenet.com
+++++++++++++++++++++++++++
>From "Thomas L. Ferrell" <ferrelltl@ornl.gov>
Date: 6 Dec 1996 00:20:58 GMT
Organization: Oak Ridge National Lab
It turns out that the answer to Bob Morris' question on the lack of
creator/file type in iostreams text files created in Symt C++ is posted
in one of the newsgroups at Symantec's sites. I'll post it if anyone
would like to see it.
tom
---------------------------
>From Liam Fitzgerald <liam@cyberplus.ca>
Subject: Unlocking a Volume
Date: 2 Dec 1996 17:03:06 GMT
Organization: Internet News Service
I am trying to write a program that will lock or unlock a mounted
volume using PSSetVInfo. I can get the volume and it's attributes and
then apply the mask to flip the bit using 0x8000 but when I try to
flip it back using the same routine etc and 0x7FFFF mask guess what! I
get a write error on my freshly locked volume. This routine writes to
the ioVAtrb and produces a software locked disk but I need a way to
get around the lock when I rewrite my unlock prg.
Any Ideas? I'm using CW8 on a 6100 and 7.5.3. I am writing this as a
68k prg.
HParamBlockRec pb1
pb1.volumeParam.ioVolIndex = 0;
AnErr = PBHGetVInfo( &pb1, FALSE );
if (AnErr) { printf("\n No such volume!"); }
pb1.volumeParam.ioVAtrb |= 0x8000;
AnErr = PBSetVInfo(&pb1, 1);
if (AnErr)
{
printf("\n error with set vol");
return (AnErr);}
+++++++++++++++++++++++++++
>From test@admin
Date: Mon, 2 Dec 96 12:13:39 +0000
Organization: (none)
Aha ! you fell for the same trap :-)
The reason is that PBSet/GetVInfo calls work with a <<COPY>> of the VCB.
Yes you can lock the volume by modifying the flags and calling PBSetVInfo
but you cant change the flags again because the volume is locked !
You need to access the original Volume Control Block directly to undo the
locking.
Apple just forgot to mention it:-)
Below are the routines that accomplish this:
HTH, Andy
void DoLock(short volRefNum)
{
OSErr err;
QHdrPtr qhp;
VCB *vcbp;
qhp= GetVCBQHdr();
vcbp = (VCB *)qhp->qHead;
// loop thru the VCB queue to find the right volume
while( vcbp)
{
if(vcbp->vcbVRefNum ==volRefNum)
break;
vcbp=(VCB *)vcbp->qLink;
}
//lock it!
vcbp->vcbAtrb|= 0x8000;
//save changes
err = FlushVol(nil,vcbp->vcbVRefNum);
}
/*****/
void DoUnlock(short volRefNum)
{
OSErr err;
QHdrPtr qhp;
VCB *vcbp;
qhp= GetVCBQHdr();
vcbp = (VCB *)qhp->qHead;
// loop thru the VCB queue to find the right volume
while( vcbp)
{
if(vcbp->vcbVRefNum ==volRefNum)
break;
vcbp=(VCB *)vcbp->qLink;
}
// unlock it!!
vcbp->vcbAtrb &= 0x7FFF;
// save changes
err = FlushVol(nil,vcbp->vcbVRefNum);
}
On Mon, Dec 2, 1996,5:03 PM Liam Fitzgerald wrote:
>I am trying to write a program that will lock or unlock a mounted
>volume using PSSetVInfo. I can get the volume and it's attributes and
>then apply the mask to flip the bit using 0x8000 but when I try to
>flip it back using the same routine etc and 0x7FFFF mask guess what! I
>get a write error on my freshly locked volume. This routine writes to
>the ioVAtrb and produces a software locked disk but I need a way to
>get around the lock when I rewrite my unlock prg.
>Any Ideas? I'm using CW8 on a 6100 and 7.5.3. I am writing this as a
>68k prg.
>
>HParamBlockRec pb1
>
>pb1.volumeParam.ioVolIndex = 0;
>AnErr = PBHGetVInfo( &pb1, FALSE );
>if (AnErr) { printf("\n No such volume!"); }
>
>pb1.volumeParam.ioVAtrb |= 0x8000;
>
>AnErr = PBSetVInfo(&pb1, 1);
>if (AnErr)
> {
> printf("\n error with set vol");
>
> return (AnErr);}
>
End of excerpt from Liam Fitzgerald.
+++++++++++++++++++++++++++
>From devon@onyx-tech.com (Devon Hubbard)
Date: Mon, 02 Dec 1996 14:41:46 -0700
Organization: Onyx Technology, Inc.
On Mon, Dec 2, 1996,5:03 PM Liam Fitzgerald wrote:
>I am trying to write a program that will lock or unlock a mounted
>volume using PSSetVInfo. I can get the volume and it's attributes and
>then apply the mask to flip the bit using 0x8000 but when I try to
>flip it back using the same routine etc and 0x7FFFF mask guess what! I
>get a write error on my freshly locked volume. This routine writes to
>the ioVAtrb and produces a software locked disk but I need a way to
>get around the lock when I rewrite my unlock prg.
>Any Ideas? I'm using CW8 on a 6100 and 7.5.3. I am writing this as a
>68k prg.
>
>HParamBlockRec pb1
>
>pb1.volumeParam.ioVolIndex = 0;
>AnErr = PBHGetVInfo( &pb1, FALSE );
>if (AnErr) { printf("\n No such volume!"); }
>
>pb1.volumeParam.ioVAtrb |= 0x8000;
>
>AnErr = PBSetVInfo(&pb1, 1);
>if (AnErr)
> {
> printf("\n error with set vol");
>
> return (AnErr);}
>
Aside from trying to do this with code from your own application, you can
use a control panel called 'LockVol' to do this. It's available on
info-mac and various other net sites as well as the Apple developer CDs.
dEVoN
---------------------------
>From stian@mail.utexas.edu (Stian Oksavik)
Subject: Utility pattern?
Date: 5 Dec 1996 16:03:48 GMT
Organization: University of Texas at Austin
In System 7, the Desktop Patterns control panel lets you set a "utility"
pattern (try holding down option and see what the set desktop pattern
turns into.)
This pattern is used by desk accessories...or, rather, by items in the
Apple Menu. Examples include Find File, Calculator and the Scrapbook.
I'd like to use this same pattern in my own programs. Does anyone know how
I can access it? (I haven't started digging in the system file yet, so
pardon this post if it's a simple matter of reading a PPAT resource from
there.)
Thanks,
-Stian
+++++++++++++++++++++++++++
>From squires@crl.com (Scott Squires)
Date: Fri, 06 Dec 1996 20:47:34 -0800
Organization: Puffin Designs
In article <stian-0512961004090001@slip-c-8.ots.utexas.edu>,
stian@mail.utexas.edu (Stian Oksavik) wrote:
>In System 7, the Desktop Patterns control panel lets you set a "utility"
>pattern (try holding down option and see what the set desktop pattern
>turns into.)
>This pattern is used by desk accessories...or, rather, by items in the
>Apple Menu. Examples include Find File, Calculator and the Scrapbook.
>
>I'd like to use this same pattern in my own programs. Does anyone know how
>I can access it? (I haven't started digging in the system file yet, so
>pardon this post if it's a simple matter of reading a PPAT resource from
>there.)
>
Get a copy of Apple's latest developer CD-ROM. (Scan their web site,
it might be there)
-scott
Scott Squires "Insert funny stuff here"
squires@crl.com
ScottSquir@aol.com
+++++++++++++++++++++++++++
>From fprefect@ambrosiasw.com (Matt Slot)
Date: Fri, 06 Dec 1996 10:41:48 -0500
Organization: Ambrosia Software
stian@mail.utexas.edu (Stian Oksavik) wrote:
> In System 7, the Desktop Patterns control panel lets you set a "utility"
> pattern (try holding down option and see what the set desktop pattern
> turns into.)
> This pattern is used by desk accessories...or, rather, by items in the
> Apple Menu. Examples include Find File, Calculator and the Scrapbook.
>
> I'd like to use this same pattern in my own programs. Does anyone know how
> I can access it? (I haven't started digging in the system file yet, so
> pardon this post if it's a simple matter of reading a PPAT resource from
> there.)
Yep, that's all there is to it... it's 'ppat' ID=42.
Matt
* * * * * * * * * * * * * * * * * * * * * * * * * * ======================
* Reality: Matt Slot, Bitwise Operator * Time is an illusion.
* E-Mail: mailto:fprefect@umich.edu * Lunchtime doubly so.
* Web: http://www.sils.umich.edu/~fprefect/ * -- Douglas Adams
* * * * * * * * * * * * * * * * * * * * * * * * * * ======================
---------------------------
>From dmiller@eentertainment.com (David Miller)
Subject: [Q] C++ and handles
Date: Tue, 03 Dec 1996 20:49:31 -0500
Organization: E! Entertainment Television
I'm a C Programmer, and I am starting to include some C++ objects in my
application. I have one application that creates and deletes many objects,
fragmenting memory after it has been running for a while.
My question is:
Is there a way to use new and delete with double indirection so the Memory
Manager will compact the heap for me?
David Miller
please respond to dmiller@eentertainment.com
+++++++++++++++++++++++++++
>From Wulf Hofbauer <wh@echo.chem.tu-berlin.de>
Date: Wed, 04 Dec 1996 14:21:51 +0100
Organization: Max-Volmer-Institut, TU Berlin
David Miller wrote:
> Is there a way to use new and delete with double indirection so the Memory
> Manager will compact the heap for me?
A partial solution would be to override the standard new and delete
operators. I guess however that this would conflict with several C++
constructs which assume pointers, not handles. I don't think it is worth
the hassle.
Personally, I think handles are a thing of the past. According to Knuth,
on average only a third of a pointer-based heap is unused due to
fragmentation. Relocating memory without special hardware to support
this is very inefficient and slows everything down, plus it may lead to
massive trashing in combination with virtual memory. There must be a
reason why so few systems use this approach, considering these topics
have been studied extensively a long time ago.
- Wulf
--
________________________________________________________
! Dipl. Phys. Wulf Hofbauer (wh@echo.chem.tu-berlin.de) !
! Max-Volmer-Institut Technische Universitaet Berlin !
! Strasse des 17. Juni 135 10623 Berlin Germany !
!________________________________________________________!
+++++++++++++++++++++++++++
>From "Pete Gontier -- DTS" <gurgle@apple.com>
Date: 6 Dec 96 11:42:00 -0800
Organization: Apple Computer, Inc.
> Is there a way to use new and delete with double indirection
> so the Memory Manager will compact the heap for me?
<http://devworld.apple.com/dev/technotes/tn/tn1009.html>
+++++++++++++++++++++++++++
>From uzs90z@uni-bonn.de (Michael Schuerig)
Date: Thu, 5 Dec 1996 03:37:45 +0100
Organization: RHRZ - University of Bonn (Germany)
David Miller <dmiller@eentertainment.com> wrote:
> I'm a C Programmer, and I am starting to include some C++ objects in my
> application. I have one application that creates and deletes many objects,
> fragmenting memory after it has been running for a while.
>
> My question is:
>
> Is there a way to use new and delete with double indirection so the Memory
> Manager will compact the heap for me?
Don't use handles unless you're forced to by the system. I even think
I've read something to the effect that Apple is going to abandon handles
some day. A better solution in your case may be to write class specific
new/delete operators for your classes or you could look at one of the
commercially available heap managment packages.
Michael
- -
Michael Schuerig
mailto:uzs90z@uni-bonn.de
http://www.rhrz.uni-bonn.de/~uzs90z/
---------------------------
>From Marc Hofmann <mhofmann@planete.net>
Subject: [Q] Convert double to string in C. How?
Date: Fri, 29 Nov 1996 10:40:07 +0100
Organization: Pressicom/Planete.net, France
language: C
Hello,
How can I set the default text for a edit text item in a dialog window
to a numeric value ( double )?
SetIText requires a Str255 text parameter. Is there a way to convert
double type variables to strings?
If not, how can I display ( numerically ) any given number in a dialog
edit text?
Thanks
Marc
+++++++++++++++++++++++++++
>From krycyb@bergen.org (Krys Cybulski)
Date: Fri, 29 Nov 1996 15:41:02 GMT
Organization: (none)
In article <329EAF74.5536@planete.net>, Marc Hofmann
<mhofmann@planete.net> wrote:
> language: C
>
> Hello,
>
> How can I set the default text for a edit text item in a dialog window
> to a numeric value ( double )?
>
> SetIText requires a Str255 text parameter. Is there a way to convert
> double type variables to strings?
> If not, how can I display ( numerically ) any given number in a dialog
> edit text?
>
> Thanks
>
> Marc
/* Float2Str255.c by Stefan Sinclair Oct. 1995
Apple provided a routine for converting integers (type 'long') to
into Str255 format (NumToString), but they forgot floating point conversion!
This simple routine converts from floating point (type 'double')
into Str255 format.
*/
#include <stdio.h> /* You need this one */
/* #include <Macheaders> <- You will need to un-comment this line.
Also, p2cstr and c2pstr are now defined in Apple's Macintosh headers.
*/
void Float2Str255(double fPt, Str255 pStr)
{
int myErr;
p2cstr(pStr); /*†Convert to (char *) */
myErr = sprintf((char *)pStr, "%G", fPt); /*†print floating point number */
/* You can easily change the output format by replacing '%G' with
whatever makes you happy. */
if(myErr >= 0) /*†Did everything go as planned? */
c2pstr((char *)pStr); /*†Back to Str255 */
/* else, here you will want to handle any error that might occur for
some freak reason. */
}
Have fun, I did not write this, but it should work...
-- Krys
+++++++++++++++++++++++++++
>From "Brian Mowatt" <Brian.Mowatt@dial.pipex.com>
Date: 29 Nov 1996 13:36:44 GMT
Organization: Crocodile Clips Ltd.
look at sprintf.
Marc Hofmann <mhofmann@planete.net> wrote in article <329EAF74.5536@planete.net>...
> language: C
>
> Hello,
>
> How can I set the default text for a edit text item in a dialog window
> to a numeric value ( double )?
>
> SetIText requires a Str255 text parameter. Is there a way to convert
> double type variables to strings?
> If not, how can I display ( numerically ) any given number in a dialog
> edit text?
>
> Thanks
>
> Marc
>
+++++++++++++++++++++++++++
>From cbarron3@ix.netcom.com
Date: Fri, 29 Nov 1996 21:40:11 -0500
Organization: Netcom
Krys Cybulski <krycyb@bergen.org> wrote:
> In article <329EAF74.5536@planete.net>, Marc Hofmann
> <mhofmann@planete.net> wrote:
>
> > language: C
> >
> > Hello,
> >
> > How can I set the default text for a edit text item in a dialog window
> > to a numeric value ( double )?
> >
> > SetIText requires a Str255 text parameter. Is there a way to convert
> > double type variables to strings?
> > If not, how can I display ( numerically ) any given number in a dialog
> > edit text?
#include <stdio.h>
#include <string.h>
/* convert double to a pascal string - 100% ansi C - adjust format
string below [in sprintf() to taste */
char *fl2pas(double x,char *buffer)
{
sprintf(buffer+1,"%f10.6",x);
*x = strlen(x+1);
return x;
}
+++++++++++++++++++++++++++
>From presnick@qualcomm.com (Pete Resnick)
Date: Fri, 29 Nov 1996 22:58:32 -0600
Organization: QUALCOMM Incorporated
In article <329EAF74.5536@planete.net>, Marc Hofmann
<mhofmann@planete.net> wrote:
>Is there a way to convert
>double type variables to strings?
The proper Macintosh international-friendly way is to use ExtendedToString.
pr
--
Pete Resnick - presnick@qualcomm.com
QUALCOMM Incorporated
+++++++++++++++++++++++++++
>From cwatson@cam.org (Sean McBride)
Date: Sun, 01 Dec 1996 12:32:35 -0500
Organization: Communications Accessibles Montreal, Quebec Canada
In article <19961129214011881488@buf-ny3-51.ix.netcom.com>,
cbarron3@ix.netcom.com wrote:
>#include <stdio.h>
>#include <string.h>
>/* convert double to a pascal string - 100% ansi C - adjust format
>string below [in sprintf() to taste */
>char *fl2pas(double x,char *buffer)
>{
> sprintf(buffer+1,"%f10.6",x);
> *x = strlen(x+1);
> return x;
>}
One thing I've always wondered, that no one seems to know (I guess I'll
have to try)...
Will this method be friendly with the settings in the Numbers control
panel? What if a comma or other character is used instead of a period?
Bye!
_________________________________________________________________________
H H | | |
| | | Sean McBride | Life is like a pubic hair |
H-C-C-O-H | cwatson@cam.org | on a toilet seat: |
| | | Montreal, Canada | eventually, you get pissed off |
H H | | |
- -----------------------------------------------------------------------
+++++++++++++++++++++++++++
>From cbarron3@ix.netcom.com
Date: Sun, 1 Dec 1996 23:25:28 -0500
Organization: Netcom
Sean McBride <cwatson@cam.org> wrote:
> In article <19961129214011881488@buf-ny3-51.ix.netcom.com>,
> cbarron3@ix.netcom.com wrote:
>
> > *x = strlen(x+1);
> > return x;
OOPS!!! these x's should be buffers's. Sorry for typos!!
> >}
>
> One thing I've always wondered, that no one seems to know (I guess I'll
> have to try)...
>
> Will this method be friendly with the settings in the Numbers control
> panel? What if a comma or other character is used instead of a period?
>
> Bye!
>
Probably not. Possibly...
+++++++++++++++++++++++++++
>From David Gillies <daggilli@vader.brad.ac.uk>
Date: Wed, 04 Dec 1996 14:31:48 +0000
Organization: University of Bradford
Sean McBride wrote:
>
> In article <19961129214011881488@buf-ny3-51.ix.netcom.com>,
> cbarron3@ix.netcom.com wrote:
>
> >#include <stdio.h>
> >#include <string.h>
> >/* convert double to a pascal string - 100% ansi C - adjust format
> >string below [in sprintf() to taste */
> >char *fl2pas(double x,char *buffer)
> >{
> > sprintf(buffer+1,"%f10.6",x);
> > *x = strlen(x+1);
> > return x;
> >}
>
> One thing I've always wondered, that no one seems to know (I guess I'll
> have to try)...
>
> Will this method be friendly with the settings in the Numbers control
> panel? What if a comma or other character is used instead of a period?
>
> Bye!
>
You are quite right - to be thoroughly worldwide compatible you'll
need to use the International Utilities which handle this in a
friendly fashion.
--
______________________________________________________________________
David A. G. Gillies (daggilli@vader.brad.ac.uk)
University of Bradford, Bradford, West Yorkshire, England
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
---------------------------
>From sandor@a.crl.com (sandor)
Subject: [Q] Rebooting from MacsBug
Date: Fri, 29 Nov 1996 09:23:48 -0800
Organization: none
There is a RAM address xxxxxxxx so that in MacsBug the command
g xxxxxxxx
will often reboot when all else (es, rs, rb) fails. Have used it
in the past and needed it the other day but could not find where
I'd written it down. If someone can help, I would appreciate it.
Sandor <sandor@a.crl.com> Fri 29 Nov 1996
+++++++++++++++++++++++++++
>From blob@ricochet.NOSPAM.net
Date: Fri, 29 Nov 1996 14:02:59 -0700
Organization: (none)
In article <sandor-2911960923480001@165.113.1.24>, sandor@a.crl.com
(sandor) wrote:
> There is a RAM address xxxxxxxx so that in MacsBug the command
>
> g xxxxxxxx
>
> will often reboot when all else (es, rs, rb) fails.
ROMBase+A will work on most machines. The PCI Macs seem to have messed this up.
--
(Pointers to other Mac programming web sites at
<http://devworld.apple.com/dev/geeks.html>)
To reply personally, take the anti-spam part, "NOSPAM." out of my email address.
+++++++++++++++++++++++++++
>From BHuey@worldnet.att.net (Hugh Johnson)
Date: Sun, 01 Dec 1996 10:47:24 -0600
Organization: Semplice
In article <blob-ya023480002911961402590001@news.ricochet.net>,
blob@ricochet.NOSPAM.net wrote:
> In article <sandor-2911960923480001@165.113.1.24>, sandor@a.crl.com
> (sandor) wrote:
>
> > There is a RAM address xxxxxxxx so that in MacsBug the command
> >
> > g xxxxxxxx
> >
> > will often reboot when all else (es, rs, rb) fails.
>
> ROMBase+A will work on most machines. The PCI Macs seem to have
> messed this up.
>
What about shutting down instead of rebooting? Sometimes when you have a
bomb at the end of the day, or just at the end of a frustrating session
when it's time to go take a long walk, you'd rather shut down than reboot.
Is there a way to do that?
+++++++++++++++++++++++++++
>From blob@ricochet.NOSPAM.net
Date: Sun, 01 Dec 1996 10:59:14 -0700
Organization: (none)
In article
<BHuey-0112961047240001@225.minnesota-002.mn.dial-access.att.net>,
BHuey@worldnet.att.net (Hugh Johnson) wrote:
> > > There is a RAM address xxxxxxxx so that in MacsBug the command
> > >
> > > g xxxxxxxx
> > >
> > > will often reboot when all else (es, rs, rb) fails.
> >
> > ROMBase+A will work on most machines. The PCI Macs seem to have
> > messed this up.
> What about shutting down instead of rebooting?
g _Power
works for me.
Note to the unexperienced: This is all a _bad_ idea. You are shutting down
without giving the OS a chance to flush any volume information in memory.
You can easily corrupt your hard disk by doing this. Use "rs" if you are
in Macsbug to flush and restart, then do a normal shutdown. It's much
safer.
--
(Pointers to other Mac programming web sites at
<http://devworld.apple.com/dev/geeks.html>)
To reply personally, remove the anti-spam "NOSPAM." from the email address
in the header.
+++++++++++++++++++++++++++
>From chris-b@cs.auckland.ac.nz (chris-b)
Date: Mon, 02 Dec 1996 11:56:35 +1300
Organization: Auckland University HMU
In article <sandor-2911960923480001@165.113.1.24>, sandor@a.crl.com
(sandor) wrote:
>There is a RAM address xxxxxxxx so that in MacsBug the command
>
> g xxxxxxxx
>
>will often reboot when all else (es, rs, rb) fails. Have used it
>in the past and needed it the other day but could not find where
>I'd written it down. If someone can help, I would appreciate it.
On my IIsi, "g power" shuts the machine down immediately.
Chris B
- ---------------------------------------------------------------------
NewZealand:AucklandUniversity:ComputerScience:HyperMediaUnit:ChrisBurns
Internet: chris-b@cs.auckland.ac.nz
Phone: +64 9 373-7599 x8976
Fax: +64 9 373-7453 Async, Therefore I Am.
- ---------------------------------------------------------------------
+++++++++++++++++++++++++++
>From Mark Simpson <M.Simpson-CSSE96@cs.bham.ac.uk>
Date: Mon, 02 Dec 1996 11:35:11 +0000
Organization: School of Computer Science, University of Birmingham, UK
Hugh Johnson wrote:
>
> In article <blob-ya023480002911961402590001@news.ricochet.net>,
> blob@ricochet.NOSPAM.net wrote:
>
> > In article <sandor-2911960923480001@165.113.1.24>, sandor@a.crl.com
> > (sandor) wrote:
> >
> > > There is a RAM address xxxxxxxx so that in MacsBug the command
> > >
> > > g xxxxxxxx
> > >
> > > will often reboot when all else (es, rs, rb) fails.
> >
> > ROMBase+A will work on most machines. The PCI Macs seem to have
> > messed this up.
> >
>
> What about shutting down instead of rebooting? Sometimes when you have a
> bomb at the end of the day, or just at the end of a frustrating session
> when it's time to go take a long walk, you'd rather shut down than reboot.
> Is there a way to do that?
Probably not. The system needs to do certain housekeeping tasks when you
shut down, and if the system has crashed, it's not likely to be in any
position to do its stuff. Personally, I just restart with the shiftkey
down - only takes thirty seconds, then go for a pint!
Mark
--
**************************************************************
** Mark Simpson (M.Simpson-csse96@cs.bham.ac.uk)
** Computer Science / Software Engineering 1
** University of Birmingham, UK
**
** "Who is and who isn't?"
**************************************************************
---------------------------
>From g-kendall@nwu.edu (Brian Kendall)
Subject: [Q] Setting the cursor location?
Date: Thu, 28 Nov 1996 09:19:04 -0400
Organization: Programmer
Hi there!
I need to know how to set the cursor location. Any ideas? Toolbox
functions? Source code? Web sites? Just let me know if you have something.
Brian K.
Have a nice day :)
+++++++++++++++++++++++++++
>From bilewicz@helf4.physik.fu-berlin.de (Roger Bilewicz)
Date: 3 Dec 96 12:33:57 GMT
Organization: Freie Universitaet Berlin
g-kendall@nwu.edu (Brian Kendall) writes:
>Hi there!
>I need to know how to set the cursor location. Any ideas? Toolbox
>functions? Source code? Web sites? Just let me know if you have something.
>Brian K.
>Have a nice day :)
Hi Brian,
The only one who is allowed to move the cursor is the user.
Accordingly, there is no toolbox call for this.
Further reference: Macintosh Human Interface Guidelines .
Roger
+++++++++++++++++++++++++++
>From David Gillies <daggilli@vader.brad.ac.uk>
Date: Wed, 04 Dec 1996 16:57:15 +0000
Organization: University of Bradford
Roger Bilewicz wrote:
>
> g-kendall@nwu.edu (Brian Kendall) writes:
>
> >Hi there!
>
> >I need to know how to set the cursor location. Any ideas? Toolbox
> >functions? Source code? Web sites? Just let me know if you have something.
>
> >Brian K.
>
> >Have a nice day :)
>
> Hi Brian,
>
> The only one who is allowed to move the cursor is the user.
>
> Accordingly, there is no toolbox call for this.
>
> Further reference: Macintosh Human Interface Guidelines .
>
> Roger
This is true. It is also false.
You can jam values into a couple of low-mem globals to set the
cursor location and then another one to tell the system what
you've dome. I do this in a joke FBA I wrote which moves the cursor
about in a Time Manager task.
--
______________________________________________________________________
David A. G. Gillies (daggilli@vader.brad.ac.uk)
University of Bradford, Bradford, West Yorkshire, England
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
+++++++++++++++++++++++++++
>From rolfe@sfu.ca (cj)
Date: 7 Dec 1996 11:17:55 GMT
Organization: Simon Fraser University
Roger Bilewicz wrote:
>>I need to know how to set the cursor location. Any ideas? Toolbox
>>functions? Source code? Web sites? Just let me know if you have something.
and someone responded with the Apple approved bad news:
<Name blanked to protect the well-intentioned>
>>The only one who is allowed to move the cursor is the user.
>>Accordingly, there is no toolbox call for this.
In fact, it's fairly easy to set the cursor. Hide the cursor, call
MoveMouse() (function below), and show the cursor.
Overriding the user input is tricky. You can never beat the user-generated
interrupt that moves the cursor unless
you decouple the mouse from the cursor.
I don't know the Apple tech note number but the response and query was:
Response: "Updating Macintosh cursor without mouse competition"
Date Written: 6/12/91
Last reviewed: 6/14/93
Query: "How can I programmatically move the Macintosh mouse without the
real mouse interfering?"
Mouse tricks code follows:
// Function prototypes
void MoveMouse(Point pt);
void MouseCouple();
void MouseDecouple();
// static globals -- low memory mouse globals
char *CrsrCouple = (char *) 0x8CF;
Point* gRawMouse = (Point*) 0x082C;
Point* gTemp = (Point*) 0x0828;
char* gMouseNew = (char*) 0x08CE;
char* gCouple = (char*) 0x08CF;
void
MoveMouse(Point pt)
{
gRawMouse->v = mTemp->v = pt.v;
gRawMouse->h = mTemp->h = pt.h;
*gMouseNew = 1;
}
void
MouseCouple()
{
char *CrsrCouple = (char *) 0x8CF;
*CrsrCouple = 1;
}
void
MouseDecouple()
{
char *CrsrCouple = (char *) 0x8CF;
*CrsrCouple = 0;
}
Chris
rolfe@sfu.ca
---------------------------
>From ghinkle@pixmap.seas.upenn.edu (Gregory J Hinkle)
Subject: [Q] Time of last key down?
Date: 6 Dec 1996 18:33:53 GMT
Organization: University of Pennsylvania
I've been working on an application that acts as a screen saver. I've
been able to set up switching processes and all after a certian period of
mouse inactivity. Does anyone know of a way to check when the last key
was pressed(even in another process). Would I have to patch the event
handler?
BTW, the project I'm working on is called Let It Snow. Its a screen
saver/ background animatior for the holiday season. You can find the
latest beta version at the address in my sig. Note: it still has the
screen saver part disabled until I can figure this keydown event stuff.
--
http://www.seas.upenn.edu/~ghinkle/prog.html
ghinkle@seas.upenn.edu
+++++++++++++++++++++++++++
>From blob@ricochet.NOSPAM.net
Date: Sat, 07 Dec 1996 11:30:11 -0700
Organization: (none)
In article <589ouh$ufv@netnews.upenn.edu>, ghinkle@pixmap.seas.upenn.edu
(Gregory J Hinkle) wrote:
> I've been working on an application that acts as a screen saver. I've
> been able to set up switching processes and all after a certian period of
> mouse inactivity. Does anyone know of a way to check when the last key
> was pressed(even in another process). Would I have to patch the event
> handler?
There is a low memory global called KeyTime which returns the time in ticks
since the last keypress. It's at location $186.
I don't believe there is a low memory accessor function for this value in
LowMem.h. Beware future compatbility.
Other than that, a jGNEFilter as described in technote 1060 at
<http://devworld.apple.com/dev/technotes/tn/tn1060.html>
--
(Pointers to other Mac programming web sites at
<http://devworld.apple.com/dev/geeks.html>)
To reply personally, remove the anti-spam "NOSPAM." from the email address
in the header.
+++++++++++++++++++++++++++
>From bc@apple.com (bill coderre)
Date: Sun, 08 Dec 1996 19:37:28 -0800
Organization: This posting does not represent the official opinion of Apple Computer, Inc.
ghinkle@pixmap.seas.upenn.edu (Gregory J Hinkle) wrote:
| I've been working on an application that acts as a screen saver. I've
| been able to set up switching processes and all after a certian period of
| mouse inactivity. Does anyone know of a way to check when the last key
| was pressed(even in another process). Would I have to patch the event
| handler?
|
| BTW, the project I'm working on is called Let It Snow. Its a screen
| saver/ background animatior for the holiday season. You can find the
| latest beta version at the address in my sig. Note: it still has the
| screen saver part disabled until I can figure this keydown event stuff.
Why not write a plug in module for After Dark or Dark Side of the Mac?
The latter is free software and works good. Tom Dowdy, famous Apple
engineer (if you stand on your head) wrote it.
bc
--
This posting in no way represents the official opinion of Apple Computer,
Inc. Contact me at bc@wetware.com or bc@apple.com to discuss my personal
opinions and those of Apple Computer, Inc. Have a Nice Day.
---------------------------
>From jsoltys@woodinville.com (John Soltys)
Subject: [Q] disposing handles to structs
Date: Mon, 02 Dec 1996 20:35:49 -0800
Organization: The Edwards Agency
I have a struct which contains a couple of pointers. When I am done with
the struct, can I call DisposeHandle ((Handle) myStructHandle) and be done
with it or do I have to dispose of each pointer within the struct before I
deallocate the struct's handle?
+++++++++++++++++++++++++++
>From Bill McElmury <bill@jmcinc.com>
Date: Tue, 03 Dec 1996 09:24:26 -0600
Organization: JMC Inc
John Soltys wrote:
>
> I have a struct which contains a couple of pointers. When I am done with
> the struct, can I call DisposeHandle ((Handle) myStructHandle) and be done
> with it or do I have to dispose of each pointer within the struct before I
> deallocate the struct's handle?
John,
If the pointers inside the struct are pointing to memory that YOU
allocated (NewPtr,malloc,etc...) then yes, you have to dispose of the
allocated memory chunks (DisposPtr,free,...) before you deallocate the
struct's handle. Otherwise you end up with allocated memory chunks
stuck permanently in your heap.
Hope this helps.
Bill
--
__________________________________________________
Bill McElmury Bill :612-345-6218
JMC Inc John :800-524-8182
PO Box 328 fax :612-345-2215
Lake City, MN 55041
+++++++++++++++++++++++++++
>From David Gillies <daggilli@vader.brad.ac.uk>
Date: Wed, 04 Dec 1996 16:33:25 +0000
Organization: University of Bradford
John Soltys wrote:
>
> I have a struct which contains a couple of pointers. When I am done with
> the struct, can I call DisposeHandle ((Handle) myStructHandle) and be done
> with it or do I have to dispose of each pointer within the struct before I
> deallocate the struct's handle?
It all depends on whether you allocated the objects that the pointers
point to, and whether you need those objects to hang around after
you've disposed of the outer structure.
E.g. : say you've ccoked up a space-saving replacement for an FSSpec:
typedef struct MyFSSpec
{
short vRefNum;
long parID;
unsigned char *name; // instead of Str63
}MyFSSpec;
typedef MyFSSpec *MyFSSpecPtr,**MyFSSpecHandle;
MyFSSpecHandle fssHand;
Str63 fName="\pshort name";
// allocate the memeory for the struct
fssHand=(MyFSSpecHandle)NewHandle(sizeof(MyFSSpec));
HLockHi((Handle)fssHand);
(*fssHand)->vRefNum=-1;
(*fssHand)->parID=23764;
(*fssHand)->name=(unsigned char*)NewPtr(fName[0]+1);
HUnlock((Handle)fssHand);
// use it ...
...
...
// dispose of it
HLockHi((Handle)fssHand);
DisposePtr((Ptr)(*fssHand)->name);
HUnlock(fssHand);
DisposeHandle((Handle)fssHand);
If all your DisposeHandle/Ptr calls match all your NewHandle/Ptr
calls then all will be well. If this is not the case then
somewhere there will be trouble.
Note also that these days people tend to prefer to use pointers
not handles - all that locking and unlocking just so you can
drop a dereference stage...
As someone pointed out the other day, the MMU should be used
to give heap relocatability, not the Memory Manager.
--
______________________________________________________________________
David A. G. Gillies (daggilli@vader.brad.ac.uk)
University of Bradford, Bradford, West Yorkshire, England
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
+++++++++++++++++++++++++++
>From spamwall@zercom.net (Martin-Gilles Lavoie)
Date: 4 Dec 1996 21:27:17 GMT
Organization: Groupimage, inc.
In article <jsoltys-0212962035490001@ppp-3-157.connect.com>,
jsoltys@woodinville.com (John Soltys) wrote:
> I have a struct which contains a couple of pointers. When I am done with
> the struct, can I call DisposeHandle ((Handle) myStructHandle) and be done
> with it or do I have to dispose of each pointer within the struct before I
> deallocate the struct's handle?
You must dispose the pointers in your struct before disposing of the
handle to the struct containing them. An easy way is to map these calls
into something like this:
Handle NewMyStructHandle (void) {
Handle myStructHandle = NewHandleClear(sizeof (struct MyStruct));
HLock(myStructHandle);
((MyStruct**) myStructHandle)[0]->myPtr = NewPtr(...)
HUnlock(myStructHandle);
return (myStructHandle);
}
void DisposeMyStructHandle(Handle &myStructHandle) {
if (myStructHandle[0]->myPtr) {
DisposePtr(myStructHandle[0]->myPtr);
myStructHandle[0]->myPtr = nil;
}
DisposeHandle(myStructHandle);
myStructHandle = nil;
}
>From your code, rather than calling NewHandleX and DisposeHandle, you'd
make these calls:
Handle myHandle = NewMyStructHandle();
//...
DisposeMyStructHandle(myStructHandle);
Note that if you're using C rather than C++, you'd have to change the
second function to this:
void DisposeMyStructHandle(Handle *myStructHandle) {
if ((*myStructHandle)[0]->myPtr) {
DisposePtr((*myStructHandle)[0]->myPtr);
(*myStructHandle)[0]->myPtr = nil;
}
DisposeHandle((*myStructHandle));
(*myStructHandle) = nil;
}
=================================================================
Please reply using the following address, rather than the
"reply-to" address (my mail box is being filled with junk mail).
=================================================================
Martin-Gilles Lavoie | Opinions expressed herein are just that.
mouser@zercom.net | "No! Do, or do not. There is no try."
Globimage, inc. | --Yoda on error handling
---------------------------
>From chris@buran.fb10.tu-berlin.de (Christian Nieber)
Subject: [Q] library-class library for easier MacOS programming?
Date: 27 Nov 1996 00:10:23 GMT
Organization: Institut fuer Energietechnik, TU-Berlin
We are looking for a library to simplify porting a large standard software
application in plain ANSI C to MacOS. Actually we have made our own portable
GUI interface, which currently exists on OS/2 and Atari-GEM (32 bit Windows
is also planned), and now we want to make a MacOS version of it. Direct Mac
Toolbox programming seems a bit awkward to me, so I am looking for something
that takes care of the routine stuff. Our requirements are:
- source code must be available
- must allow for good Mac look&feel
- speed and code size is an issue, so there should not be too much overhead
- can be commercial, shareware or whatever
- in the best case it should handle (modeless) dialogs, windows, drawing,
printing, and as many protocols as possible (Clipboard, drag&drop, EasyOpen,
OpenDoc etc.). Vector and bitmap graphics would be a plus.
Some people have recommended me to use PowerPlant, but that seems like quite
an overkill to me, since it's much to learn and much overhead, and after all
we already have our own GUI programming model. Isn't there something smaller
and preferably in C out there?
- -------------------------------------------------------------------
Christian Nieber (R.O.M. logicware) +-----------------+
email chris@buran.fb10.tu-berlin.de | Always plan ahea|
Neue Bergstr. 5, D-13585 Berlin, Germany |________________d|
Tel. ++49 / 30 / 335 79 00 | |
- -------------------------------------------------------------------
+++++++++++++++++++++++++++
>From blasirs@franklin.CS.Berkeley.EDU (Robert_S Blasi)
Date: 30 Nov 1996 23:30:16 GMT
Organization: University of California, Berkeley
In article <57g0tf$ipc@brachio.zrz.TU-Berlin.DE>,
Christian Nieber <chris@buran.fb10.tu-berlin.de> wrote:
>We are looking for a library to simplify porting a large standard software
>application in plain ANSI C to MacOS. Actually we have made our own portable
>GUI interface, which currently exists on OS/2 and Atari-GEM (32 bit Windows
>is also planned), and now we want to make a MacOS version of it. Direct Mac
>Toolbox programming seems a bit awkward to me, so I am looking for something
>that takes care of the routine stuff. Our requirements are:
>
> - source code must be available
> - must allow for good Mac look&feel
> - speed and code size is an issue, so there should not be too much overhead
> - can be commercial, shareware or whatever
> - in the best case it should handle (modeless) dialogs, windows, drawing,
>printing, and as many protocols as possible (Clipboard, drag&drop, EasyOpen,
>OpenDoc etc.). Vector and bitmap graphics would be a plus.
>
>Some people have recommended me to use PowerPlant, but that seems like quite
>an overkill to me, since it's much to learn and much overhead, and after all
>we already have our own GUI programming model. Isn't there something smaller
>and preferably in C out there?
Hm. You might want to head to the bookstore and look for
"Programming Starter Kit" by Jim Trudeau. I remember that he developed
a simple framework in C in this book called "EasyApp" that supported
most of the things you listed above. I have no idea what the restrictions
on its use and distribution are; you'd probably have to contact the author
But if you want to get an idea of how to handle the routine stuff, it
might be a good place to start.
VTY, Rob Blasi
--
| Robert S. Blasi | "The mind is not a vessel to be |
| Drexel University, B.S.E.E '95 | filled, but a fire to be lit." |
| M.S. candidate, Berkeley, Robotics | --Plutarch |
+-----------------http://www.cs.berkeley.edu/~blasirs---------------------+
+++++++++++++++++++++++++++
>From msbishop@ix.netcom.com (Matt Bishop)
Date: Fri, 06 Dec 1996 00:42:16 -0500
Organization: Zip News
>>We are looking for a library to simplify porting a large standard software
>>application in plain ANSI C to MacOS. Actually we have made our own portable
>>GUI interface, which currently exists on OS/2 and Atari-GEM (32 bit Windows
>>is also planned), and now we want to make a MacOS version of it. Direct Mac
>>Toolbox programming seems a bit awkward to me, so I am looking for something
>>that takes care of the routine stuff. Our requirements are:
>>
>> - source code must be available
>> - must allow for good Mac look&feel
>> - speed and code size is an issue, so there should not be too much overhead
>> - can be commercial, shareware or whatever
>> - in the best case it should handle (modeless) dialogs, windows, drawing,
>>printing, and as many protocols as possible (Clipboard, drag&drop, EasyOpen,
>>OpenDoc etc.). Vector and bitmap graphics would be a plus.
>>
>>Some people have recommended me to use PowerPlant, but that seems like quite
>>an overkill to me, since it's much to learn and much overhead, and after all
>>we already have our own GUI programming model. Isn't there something smaller
>>and preferably in C out there?
>
Another option is MacZoop. It is a C++ framework, but it is very, very
small, <80K compiled. The newest version (1.5) handles most of the
protocols and functionality you are looking for. It is free, too.
http://www.warwick.ac.uk/~corbe/MacZoop/MacZoop.html
You will still have to learn the Toolbox, though. Sorry, there isn't
anything out there that lets you avoid that completely.
--
Matt Bishop
msbishop@ix.netcom.com
---------------------------
>From balindauer@aol.com
Subject: [Q]: Patching _Launch?
Date: 2 Dec 1996 09:03:10 GMT
Organization: AOL http://www.aol.com
I'm writing an INIT that will take some action when an application is
launched. So I'm trying to patch the _Launch trap, and it isn't
working... Any idea what I'm doing wrong?
Code is thus:
8<------------------------------ cut here
pascal OSErr (*gOldLaunch)(LaunchPBPtr launchPB);
pascal OSErr MyLaunch( LaunchPBPtr launchPB);
enum {
uppLaunchApplicationProcInfo = kRegisterBased
| RESULT_SIZE( SIZE_CODE( sizeof( OSErr)))
| REGISTER_RESULT_LOCATION( kRegisterD0)
| REGISTER_ROUTINE_PARAMETER(1, kRegisterA0,
SIZE_CODE(sizeof(LaunchPBPtr)))
};
void main(void)
{
THz oldZone;
oldZone = GetZone();
SetZone(SystemZone());
DetachResource(GetResource('INIT', -4050));
gOldLaunch = (void *) GetToolTrapAddress( _Launch);
SetToolTrapAddress( NewRoutineDescriptor((ProcPtr) MyLaunch,
uppLaunchApplicationProcInfo, kPowerPCISA), _Launch);
SetZone(oldZone);
}
pascal OSErr MyLaunch( LaunchPBPtr launchPB)
{
short result;
SysBeep(10);
result = CallUniversalProc((UniversalProcPtr) gOldLaunch,
uppLaunchApplicationProcInfo, launchPB);
return result;
}
8<-------------------------------- cut here
When I run this, it seems to work the first time (when Finder is
launched), but not after that. I'm a little mystified on how this should
work, because _Launch is a register based trap, expecting a
LaunchParamBlockRecPtr in A0. But this is PowerPC native code, so there
is no A0...
Please Help! Thanks in advance...
--Bradley
balindauer@aol.com
+++++++++++++++++++++++++++
>From blob@ricochet.NOSPAM.net
Date: Mon, 02 Dec 1996 07:58:14 -0700
Organization: (none)
In article <19961202090400.EAA09481@ladder01.news.aol.com>,
balindauer@aol.com wrote:
> I'm writing an INIT that will take some action when an application is
> launched. So I'm trying to patch the _Launch trap, and it isn't
> working... Any idea what I'm doing wrong?
_Launch is one of several traps which are replaced when the process manager
starts up. This means that you have to patch a different trap and wait for
the process manager to start; then you can patch _Launch.
I use _InitMenus as my preliminary trap. In the patch to _InitMenus, I
check if the trap _OSDispatch is implemented. If so, then the process
manager is running, and I can safely patch _Launch.
/*
*
* PatchLaunch
*
* An example of patching _Launch trap. Since the Process Manager overwrites
* _Launch, we patch InitMenus and wait until _Launch is patched.
* We then check that _OSDispatch is implemented. If it is, we assume that
* the Process Manager is up, and we can safely patch _Launch.
*
*/
/* #include files */
#include <A4Stuff.h>
#include <SetupA4.h>
#include <SegLoad.h>
#include <Traps.h>
#include <Processes.h>
#include <Events.h>
enum {
kINITid = 0,
kCapsLockKey = 0x39
};
/* InitMenus patch stuff */
typedef pascal void (*InitMenusProc)(void);
pascal void InitMenusPatch(void);
InitMenusProc gOldInitMenusAddr = nil;
/* Launch patch stuff */
asm pascal void LaunchPatch(void);
typedef pascal void (*LaunchProc)(void);
LaunchProc gOldLaunchAddr = nil;
/* main */
void main(void)
{
Handle h;
long oldA4;
/* Set up our A4 context for this file */
oldA4 = SetCurrentA4();
RememberA4();
/* detach ourselves */
h = Get1Resource('INIT', kINITid);
if (h)
DetachResource(h);
/* patch InitMenus */
gOldInitMenusAddr = (InitMenusProc)GetToolTrapAddress(_InitMenus);
SetToolTrapAddress((UniversalProcPtr)InitMenusPatch, _InitMenus);
/* Restore the A4 world */
SetA4(oldA4);
/* That's it for the actual INIT code */
}
/*
* InitMenusPatch
*
* This is patch which exists only until the process manager is up.
* Check that the OSDispatch trap is implemented. When it is, patch
* Launch and remove ourself so we don't patch Launch a second time.
*/
pascal void InitMenusPatch(void)
{
long oldA4;
oldA4 = SetUpA4();
if ( GetToolTrapAddress(_OSDispatch) !=
GetToolTrapAddress(_Unimplemented) )
{
/* OSDispatch is implemented. Go ahead and patch Launch */
gOldLaunchAddr = (LaunchProc)GetToolTrapAddress(_Launch);
SetToolTrapAddress((UniversalProcPtr)LaunchPatch, _Launch);
/* We don't need this patch anymore. Remove it */
SetToolTrapAddress((UniversalProcPtr)gOldInitMenusAddr, _InitMenus);
}
/* call through to the original InitMenus */
gOldInitMenusAddr();
RestoreA4(oldA4);
}
/*
* LaunchPatch
*/
asm pascal void LaunchPatch(void)
{
/* your code goes here */
}
--
(Pointers to other Mac programming web sites at
<http://devworld.apple.com/dev/geeks.html>)
To reply personally, remove the anti-spam "NOSPAM." from the email address
in the header.
+++++++++++++++++++++++++++
>From tonyn@tiac.net (Tony Nelson)
Date: Thu, 05 Dec 1996 17:06:29 -0500
Organization: <none>
In article <19961202090400.EAA09481@ladder01.news.aol.com>,
balindauer@aol.com wrote:
> I'm writing an INIT that will take some action when an application is
> launched. So I'm trying to patch the _Launch trap, and it isn't
> working... Any idea what I'm doing wrong?
No, but you might be able to patch some other trap that gets called early
in the app's startup, such as _InitGraf.
____________________________________________________________________
TonyN.:' tonyn@tiac.net
'
---------------------------
>From lapalut@sophia.inria.fr (Stephane Lapalut)
Subject: [Q]: recovering mac stuffit archive with NDD 3.1 ?
Date: 28 Nov 1996 09:02:41 GMT
Organization: INRIA Sophia-Antipolis
Hi,
I try to recover a stuffit archive accidentaly erased. Norton unerase
give me a .data and .rsrc apparently belonging to the erased file.
I have tried to put them together with resedit but the resulting file
still bugged for StuffitExpander.
Does someone have an idea to make the things working ? Is there a way to
recover stuffit data without the resources ?
Thanks for any suggestions,
Stephane
DISCLAIMER: opinions expressed here are only mime, unless specified
- --------
StÈphane Lapalut, projet ACACIA, INRIA Sophia Antipolis, France
http://www.inria.fr/acacia/personnel/lapalut/steph.html
+++++++++++++++++++++++++++
>From galley@texas.net (Gordon B. Alley)
Date: Thu, 28 Nov 1996 23:38:44 -0600
Organization: Texas Networking, Inc.
In article <57jkfh$2m3@news-sop.inria.fr>, lapalut@sophia.inria.fr wrote:
> Hi,
>
> I try to recover a stuffit archive accidentaly erased. Norton unerase
> give me a .data and .rsrc apparently belonging to the erased file.
>
> I have tried to put them together with resedit but the resulting file
> still bugged for StuffitExpander.
>
> Does someone have an idea to make the things working ? Is there a way to
> recover stuffit data without the resources ?
>
> Thanks for any suggestions,
>
>Stephane
Actually, I believe the resource fork isn't used for anything other than
Finder info in a .sit file. Try taking just a copy of the .data file,
renaming it whatever.sit, and then dropping that file onto StuffIt
Expander.
--
--Gordon Alley <*> <galley@texas.net>
+++++++++++++++++++++++++++
>From discoco@cats.ucsc.edu (Christopher Louis Smith)
Date: 4 Dec 1996 18:48:05 GMT
Organization: University of California, Santa Cruz
In article <galley-ya023480002811962338450001@news.texas.net>,
Gordon B. Alley <galley@texas.net> wrote:
>In article <57jkfh$2m3@news-sop.inria.fr>, lapalut@sophia.inria.fr wrote:
>
>> Hi,
>>
>> I try to recover a stuffit archive accidentaly erased. Norton unerase
>> give me a .data and .rsrc apparently belonging to the erased file.
>>
>> I have tried to put them together with resedit but the resulting file
>> still bugged for StuffitExpander.
>>
>> Does someone have an idea to make the things working ? Is there a way to
>> recover stuffit data without the resources ?
>>
>> Thanks for any suggestions,
>>
>>Stephane
I think the reality here is that your recovery using Norton
was incomplete. And *especially* with .sit archives, just one
bit of data out of place will likely make the archive
unusable. So I suspect you are out of luck. Hopefully you have
a backup of your file somehere. Take care.
-CLS
---------------------------
>From vince@deas.harvard.edu (Vince Darley)
Subject: code for Async File Output
Date: Tue, 26 Nov 1996 11:14:16 -0500
Organization: Harvard University
I currently use the basic FSRead FSWrite .. routines with FSSpecs pointing
to my files. Since my output routines are very straightforward: I just
create/over-write two files and keeping FSWrite'ing to them (always from
the current position) and then set the EOF and close them, it struck me
this would be a good situation to speed things up by writing
asynchronously.
However my attempts from reading the async routines seem to crash, so I'm
looking for some sample code to do this.
(none seems to be on apple's source sites, although I may have missed something)
any help?,
--
-********* *-
-* Vince *-
-* *********-
<http://www.fas.harvard.edu/~darley/>
+++++++++++++++++++++++++++
>From SouthSide@kagi.com (Bob Bradley)
Date: Tue, 26 Nov 1996 23:12:34 -0800
Organization: SPC
In article <vince-ya023180002611961114160001@fas-news.harvard.edu>,
vince@deas.harvard.edu (Vince Darley) wrote:
> I currently use the basic FSRead FSWrite .. routines with FSSpecs pointing
> to my files. Since my output routines are very straightforward: I just
> create/over-write two files and keeping FSWrite'ing to them (always from
> the current position) and then set the EOF and close them, it struck me
> this would be a good situation to speed things up by writing
> asynchronously.
>
> However my attempts from reading the async routines seem to crash, so I'm
> looking for some sample code to do this.
There's a good article on writing async code in Develop. The article is
called something like Async Routines on the Macintosh by Jim Luther.
Without having any more details it's hard to guess what's wrong but, what
are you doing in your completion routine? There are a lot of limitations
on what can happen at interrupt time (ie. when your completion routine is
called). Try simply setting a flag from the completion routine and check
that flag in your event loop.
+++++++++++++++++++++++++++
>From David Gillies <daggilli@vader.brad.ac.uk>
Date: Thu, 28 Nov 1996 19:27:08 +0000
Organization: University of Bradford
Vince Darley wrote:
>
> I currently use the basic FSRead FSWrite .. routines with FSSpecs pointing
> to my files. Since my output routines are very straightforward: I just
> create/over-write two files and keeping FSWrite'ing to them (always from
> the current position) and then set the EOF and close them, it struck me
> this would be a good situation to speed things up by writing
> asynchronously.
>
> However my attempts from reading the async routines seem to crash, so I'm
> looking for some sample code to do this.
>
> (none seems to be on apple's source sites, although I may have missed something)
>
> any help?,
>
Reading and writing asynchronously is best accomplished using
PBWriteAsync and PBReadAsync. But to do this you need to allocate
a separate ParamBlock for each call that is currently active (you
can re-use them of course, but it requires some fairly sophisticated
strategies to do this). If you have them referencing the same buffer
then you have to block (i.e. go into an idle loop) until calls have
finished. You lose most of the advantages of async this way. To really
make use of async IO you need multiple buffers, and managing them
becomes problematical, to say the least.
I can't give code on this one as the hair-tearing I underwent
implementing this resulted in commercial-grade code. I am open to
offers, though (says he, hopefully).
Why, oh why, can't we have a threaded File Manager?
--
______________________________________________________________________
David A. G. Gillies (daggilli@vader.brad.ac.uk)
University of Bradford, Bradford, West Yorkshire, England
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
+++++++++++++++++++++++++++
>From Horst Pralow <h_pralow@overnet.de>
Date: Thu, 28 Nov 1996 20:08:08 +0000
Organization: overnet
> >
> > However my attempts from reading the async routines seem to crash, so I'm
> > looking for some sample code to do this.
> >
>
> MacTech Magazine has an article this month on exactly that topic.
Here's another gotcha you might keep in mind: If you happen to async-
read a file that has been compressed with AutoDoubler (and AutoDoubler
active) you'll run into trouble since AutoDoubler doesn't support
asynch reads on compressed files (At least the version I had this
trouble with.) This may be true for other compression engines too.
So always try a sync read in case your async one fails for non obviuous
reasons!
Horst
+++++++++++++++++++++++++++
>From squires@crl.com (Scott Squires)
Date: Mon, 02 Dec 1996 07:55:54 -0800
Organization: Puffin Designs
In article <329DE78C.6B21@vader.brad.ac.uk>,
David Gillies <daggilli@vader.brad.ac.uk> wrote:
>Vince Darley wrote:
>>
>> I currently use the basic FSRead FSWrite .. routines with FSSpecs pointing
>> to my files. Since my output routines are very straightforward: I just
>> create/over-write two files and keeping FSWrite'ing to them (always from
>> the current position) and then set the EOF and close them, it struck me
>> this would be a good situation to speed things up by writing
>> asynchronously.
>>
>> However my attempts from reading the async routines seem to crash, so I'm
>> looking for some sample code to do this.
>>
>> (none seems to be on apple's source sites, although I may have missed something)
>>
>> any help?,
>>
>Reading and writing asynchronously is best accomplished using
>PBWriteAsync and PBReadAsync. But to do this you need to allocate
>a separate ParamBlock for each call that is currently active (you
>can re-use them of course, but it requires some fairly sophisticated
>strategies to do this). If you have them referencing the same buffer
>then you have to block (i.e. go into an idle loop) until calls have
>finished. You lose most of the advantages of async this way. To really
>make use of async IO you need multiple buffers, and managing them
>becomes problematical, to say the least.
Check out the December issue of MacTech. Async I/O and buffering.
-scott
Scott Squires "Insert funny stuff here"
squires@crl.com
ScottSquir@aol.com
---------------------------
End of C.S.M.P. Digest
**********************